kopia lustrzana https://github.com/hholzgra/maposmatic/
hook into status update messages (Issue #93)
rodzic
77dba38814
commit
03a8ebe1f4
|
@ -419,6 +419,10 @@ class JobRenderer(threading.Thread):
|
|||
except Exception as e:
|
||||
LOG.warning("PNG color reduction failed: %s" % e)
|
||||
|
||||
def _status_update(self, msg):
|
||||
self.job.renderstep = msg
|
||||
self.job.save()
|
||||
|
||||
def run(self):
|
||||
"""Renders the given job, encapsulating all processing errors and
|
||||
exceptions.
|
||||
|
@ -438,6 +442,8 @@ class JobRenderer(threading.Thread):
|
|||
result_file_prefix = os.path.join(RENDERING_RESULT_PATH, self.job.files_prefix())
|
||||
os.makedirs(os.path.dirname(result_file_prefix), exist_ok=True)
|
||||
|
||||
config.status_update = self._status_update
|
||||
|
||||
# TODO have the create form provide this
|
||||
config.origin_url = 'https://print.get-map.org' + self.job.get_absolute_url()
|
||||
|
||||
|
|
|
@ -702,5 +702,5 @@ def api_rendering_status(request, id, nonce=None):
|
|||
'refresh': refresh,
|
||||
'progress': progress,
|
||||
'queue_size': queue_size,
|
||||
'status': 'working'
|
||||
'status': job.renderstep or "working",
|
||||
})
|
||||
|
|
Ładowanie…
Reference in New Issue