Skip to content

Commit 2cf0e95

Browse files
committed
Cleanup all redondant status storage
1 parent 02d947e commit 2cf0e95

2 files changed

Lines changed: 1 addition & 43 deletions

File tree

pywps/app/Process.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ def from_json(cls, value):
130130

131131
def execute(self, wps_request, uuid):
132132
self._set_uuid(uuid)
133-
self._setup_status_storage()
134133
self.async_ = False
135134
wps_response = WPSExecuteResponse(self, wps_request, self.uuid)
136135

@@ -165,23 +164,6 @@ def _set_uuid(self, uuid):
165164
for outpt in self.outputs:
166165
outpt.uuid = uuid
167166

168-
def _setup_status_storage(self):
169-
self._status_store = StorageBuilder.buildStorage()
170-
171-
@property
172-
def status_store(self):
173-
if self._status_store is None:
174-
self._setup_status_storage()
175-
return self._status_store
176-
177-
@property
178-
def status_location(self):
179-
return self.status_store.location(self.status_filename)
180-
181-
@property
182-
def status_filename(self):
183-
return str(self.uuid) + '.xml'
184-
185167
@property
186168
def status_url(self):
187169
base_url = config.get_config_value('server', 'url')

pywps/app/WPSExecuteResponse.py

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ def _update_status(self, status, message, status_percentage, clean=True):
123123
self.wps_request.preprocess_response = None
124124

125125
LOGGER.debug("_update_status: status={}, clean={}".format(status, clean))
126-
self._update_status_doc()
127-
if self.store_status_file:
128-
self._update_status_file()
129126
if clean:
130127
if self.status == WPS_STATUS.SUCCEEDED or self.status == WPS_STATUS.FAILED:
131128
LOGGER.debug("clean workdir: status={}".format(status))
@@ -145,26 +142,6 @@ def update_status(self, message, status_percentage=None):
145142
status_percentage = self.status_percentage
146143
self._update_status(self.status, message, status_percentage, False)
147144

148-
def _update_status_doc(self):
149-
try:
150-
# rebuild the doc
151-
self.doc = StatusResponse(self.wps_request.version, self.uuid,
152-
get_default_response_mimetype()).get_data(as_text=True)
153-
self.content_type = get_default_response_mimetype()
154-
except Exception as e:
155-
raise NoApplicableCode('Building Response Document failed with : {}'.format(e))
156-
157-
def _update_status_file(self):
158-
# TODO: check if file/directory is still present, maybe deleted in mean time
159-
try:
160-
# update the status xml file
161-
self.process.status_store.write(
162-
self.doc,
163-
self.process.status_filename,
164-
data_format=FORMATS.XML)
165-
except Exception as e:
166-
raise NoApplicableCode('Writing Response Document failed with : {}'.format(e))
167-
168145
def _process_accepted(self):
169146
percent = int(self.status_percentage)
170147
if percent > 99:
@@ -233,8 +210,7 @@ def as_json_for_execute_template(self):
233210
}
234211

235212
if self.store_status_file:
236-
if self.process.status_location:
237-
data["status_location"] = self.process.status_url
213+
data["status_location"] = self.process.status_url
238214

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

0 commit comments

Comments
 (0)