Skip to content

Commit

Permalink
Add option to keep old status file
Browse files Browse the repository at this point in the history
  • Loading branch information
gschwind committed Feb 7, 2024
1 parent a660ea3 commit 4c34f45
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions default-sample.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ maxprocesses=30
parallelprocesses=2
storagetype=file

# Keep old status file for backward compatibility, pywps does not need it.
keep_status_file=false

# hardcoded default : tempfile.gettempdir()
#temp_path=/tmp

Expand Down
3 changes: 2 additions & 1 deletion pywps/app/Process.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ def from_json(cls, value):

def execute(self, wps_request, uuid):
self._set_uuid(uuid)
self._setup_status_storage()
if config.get_config_value('server', 'keep_status_file'):
self._setup_status_storage()
self.async_ = False
wps_response = WPSExecuteResponse(self, wps_request, self.uuid)

Expand Down
10 changes: 5 additions & 5 deletions pywps/app/WPSExecuteResponse.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,10 @@ def _update_status(self, status, message, status_percentage, clean=True):
self.wps_request.preprocess_response = None

LOGGER.debug("_update_status: status={}, clean={}".format(status, clean))
self._update_status_doc()
if self.store_status_file:
self._update_status_file()
if config.get_config_value('server', 'keep_status_file'):
self._update_status_doc()
if self.store_status_file:
self._update_status_file()
if clean:
if self.status == WPS_STATUS.SUCCEEDED or self.status == WPS_STATUS.FAILED:
LOGGER.debug("clean workdir: status={}".format(status))
Expand Down Expand Up @@ -232,8 +233,7 @@ def as_json_for_execute_template(self):
}

if self.store_status_file:
if self.process.status_location:
data["status_location"] = self.process.status_url
data["status_location"] = self.process.status_url

if self.status == WPS_STATUS.ACCEPTED:
self.message = 'PyWPS Process {} accepted'.format(self.process.identifier)
Expand Down
1 change: 1 addition & 0 deletions pywps/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def load_hardcoded_configuration():
CONFIG.set('server', 'storage_copy_function', 'copy')
CONFIG.set("server", "default_mimetype", "text/xml")
CONFIG.set("server", "json_indent", "2")
CONFIG.set("server", "keep_status_file", "false")

CONFIG.add_section('processing')
CONFIG.set('processing', 'mode', 'default')
Expand Down

0 comments on commit 4c34f45

Please sign in to comment.