diff --git a/app/models/task.py b/app/models/task.py index 530de0b0..d068813e 100644 --- a/app/models/task.py +++ b/app/models/task.py @@ -445,7 +445,6 @@ class Task(models.Model): nonlocal last_update time_has_elapsed = time.time() - last_update >= 2 - if time_has_elapsed: testWatch.manual_log_call("Task.process.callback") self.check_if_canceled() @@ -483,13 +482,11 @@ class Task(models.Model): self.status = status_codes.CANCELED self.pending_action = None self.save() - elif self.import_url: - # Imported tasks need no special action + else: + # Tasks with no processing node or UUID need no special action self.status = status_codes.CANCELED self.pending_action = None self.save() - else: - raise NodeServerError("Cannot cancel a task that has no processing node or UUID") elif self.pending_action == pending_actions.RESTART: logger.info("Restarting {}".format(self)) diff --git a/nodeodm/external/NodeODM b/nodeodm/external/NodeODM index 2a5d73ae..48cf7f01 160000 --- a/nodeodm/external/NodeODM +++ b/nodeodm/external/NodeODM @@ -1 +1 @@ -Subproject commit 2a5d73ae2dfc89fc69f24095baebe31f0f0ac340 +Subproject commit 48cf7f01b2ab96b6fdbdcb81d4ddc5828ae66c0e diff --git a/nodeodm/models.py b/nodeodm/models.py index b98408e9..cd7a47ad 100644 --- a/nodeodm/models.py +++ b/nodeodm/models.py @@ -116,15 +116,7 @@ class ProcessingNode(models.Model): opts = self.options_list_to_dict(options) - if not settings.TESTING: - 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) - + task = api_client.create_task(images, opts, name, progress_callback) return task.uuid def get_task_info(self, uuid, with_output=None): diff --git a/requirements.txt b/requirements.txt index b14df838..50524b6a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -37,7 +37,7 @@ pip-autoremove==0.9.0 psycopg2==2.7.4 psycopg2-binary==2.7.4 PyJWT==1.5.3 -pyodm==1.5.1 +pyodm==1.5.3 pyparsing==2.1.10 pytz==2018.3 rcssmin==1.0.6