kopia lustrzana https://github.com/OpenDroneMap/WebODM
Fixed #657, better cancel task support
rodzic
9702e5e5b7
commit
b86847bb54
|
@ -445,7 +445,6 @@ class Task(models.Model):
|
||||||
nonlocal last_update
|
nonlocal last_update
|
||||||
|
|
||||||
time_has_elapsed = time.time() - last_update >= 2
|
time_has_elapsed = time.time() - last_update >= 2
|
||||||
|
|
||||||
if time_has_elapsed:
|
if time_has_elapsed:
|
||||||
testWatch.manual_log_call("Task.process.callback")
|
testWatch.manual_log_call("Task.process.callback")
|
||||||
self.check_if_canceled()
|
self.check_if_canceled()
|
||||||
|
@ -483,13 +482,11 @@ class Task(models.Model):
|
||||||
self.status = status_codes.CANCELED
|
self.status = status_codes.CANCELED
|
||||||
self.pending_action = None
|
self.pending_action = None
|
||||||
self.save()
|
self.save()
|
||||||
elif self.import_url:
|
else:
|
||||||
# Imported tasks need no special action
|
# Tasks with no processing node or UUID need no special action
|
||||||
self.status = status_codes.CANCELED
|
self.status = status_codes.CANCELED
|
||||||
self.pending_action = None
|
self.pending_action = None
|
||||||
self.save()
|
self.save()
|
||||||
else:
|
|
||||||
raise NodeServerError("Cannot cancel a task that has no processing node or UUID")
|
|
||||||
|
|
||||||
elif self.pending_action == pending_actions.RESTART:
|
elif self.pending_action == pending_actions.RESTART:
|
||||||
logger.info("Restarting {}".format(self))
|
logger.info("Restarting {}".format(self))
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2a5d73ae2dfc89fc69f24095baebe31f0f0ac340
|
Subproject commit 48cf7f01b2ab96b6fdbdcb81d4ddc5828ae66c0e
|
|
@ -116,15 +116,7 @@ class ProcessingNode(models.Model):
|
||||||
|
|
||||||
opts = self.options_list_to_dict(options)
|
opts = self.options_list_to_dict(options)
|
||||||
|
|
||||||
if not settings.TESTING:
|
task = api_client.create_task(images, opts, name, progress_callback)
|
||||||
task = api_client.create_task(images, opts, name, progress_callback)
|
|
||||||
else:
|
|
||||||
# The create_task function uses multi-threaded parallel uploads
|
|
||||||
# but Django tests cannot cope with DB updates from different threads
|
|
||||||
# (and progress_callback often updates the DB). So during testing
|
|
||||||
# we use the fallback function equivalent which is single-threaded
|
|
||||||
task = api_client.create_task_fallback(images, opts, name, progress_callback)
|
|
||||||
|
|
||||||
return task.uuid
|
return task.uuid
|
||||||
|
|
||||||
def get_task_info(self, uuid, with_output=None):
|
def get_task_info(self, uuid, with_output=None):
|
||||||
|
|
|
@ -37,7 +37,7 @@ pip-autoremove==0.9.0
|
||||||
psycopg2==2.7.4
|
psycopg2==2.7.4
|
||||||
psycopg2-binary==2.7.4
|
psycopg2-binary==2.7.4
|
||||||
PyJWT==1.5.3
|
PyJWT==1.5.3
|
||||||
pyodm==1.5.1
|
pyodm==1.5.3
|
||||||
pyparsing==2.1.10
|
pyparsing==2.1.10
|
||||||
pytz==2018.3
|
pytz==2018.3
|
||||||
rcssmin==1.0.6
|
rcssmin==1.0.6
|
||||||
|
|
Ładowanie…
Reference in New Issue