Skip to content

Commit c67cd9d

Browse files
committed
Add option to keep old status file
1 parent d970fa6 commit c67cd9d

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

default-sample.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ maxprocesses=30
6161
parallelprocesses=2
6262
storagetype=file
6363

64+
# Keep old status file for backward compatibility, pywps does not need it.
65+
keep_status_file=false
66+
6467
# hardcoded default : tempfile.gettempdir()
6568
#temp_path=/tmp
6669

pywps/app/Process.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ def from_json(cls, value):
128128

129129
def execute(self, wps_request, uuid):
130130
self._set_uuid(uuid)
131-
self._setup_status_storage()
131+
if config.get_config_value('server', 'keep_status_file'):
132+
self._setup_status_storage()
132133
self.async_ = False
133134
wps_response = WPSExecuteResponse(self, wps_request, self.uuid)
134135

pywps/app/WPSExecuteResponse.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,10 @@ def _update_status(self, status, message, status_percentage, clean=True):
122122
self.wps_request.preprocess_response = None
123123

124124
LOGGER.debug("_update_status: status={}, clean={}".format(status, clean))
125-
self._update_status_doc()
126-
if self.store_status_file:
127-
self._update_status_file()
125+
if config.get_config_value('server', 'keep_status_file'):
126+
self._update_status_doc()
127+
if self.store_status_file:
128+
self._update_status_file()
128129
if clean:
129130
if self.status == WPS_STATUS.SUCCEEDED or self.status == WPS_STATUS.FAILED:
130131
LOGGER.debug("clean workdir: status={}".format(status))
@@ -232,8 +233,7 @@ def as_json_for_execute_template(self):
232233
}
233234

234235
if self.store_status_file:
235-
if self.process.status_location:
236-
data["status_location"] = self.process.status_url
236+
data["status_location"] = self.process.status_url
237237

238238
if self.status == WPS_STATUS.ACCEPTED:
239239
self.message = 'PyWPS Process {} accepted'.format(self.process.identifier)

pywps/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def load_hardcoded_configuration():
118118
CONFIG.set('server', 'storage_copy_function', 'copy')
119119
CONFIG.set("server", "default_mimetype", "text/xml")
120120
CONFIG.set("server", "json_indent", "2")
121+
CONFIG.set("server", "keep_status_file", "false")
121122

122123
CONFIG.add_section('processing')
123124
CONFIG.set('processing', 'mode', 'default')

0 commit comments

Comments
 (0)