diff --git a/app/models/task.py b/app/models/task.py index f185549c..d00e7e3a 100644 --- a/app/models/task.py +++ b/app/models/task.py @@ -688,8 +688,7 @@ class Task(models.Model): nonlocal total_images resized_images_count += 1 - if time.time() - last_update >= 2 or resized_images_count == total_images: - logger.info(self.id) + if time.time() - last_update >= 2: Task.objects.filter(pk=self.id).update(resize_progress=(float(resized_images_count) / float(total_images))) last_update = time.time() @@ -698,6 +697,8 @@ class Task(models.Model): partial(resize_image, resize_to=self.resize_to, done=callback), images_path))) + Task.objects.filter(pk=self.id).update(resize_progress=1.0) + return resized_images def resize_gcp(self, resized_images): diff --git a/app/tests/test_api_task.py b/app/tests/test_api_task.py index c9f9a045..0a30d0fd 100644 --- a/app/tests/test_api_task.py +++ b/app/tests/test_api_task.py @@ -163,6 +163,7 @@ class TestApiTask(BootTransactionTestCase): self.assertTrue(float(py) == 8.0) # Didn't change # Resize progress is 100% + resized_task.refresh_from_db() self.assertEqual(resized_task.resize_progress, 1.0) # Upload progress is 100% diff --git a/nodeodm/external/NodeODM b/nodeodm/external/NodeODM index bcbec55c..d0e1e142 160000 --- a/nodeodm/external/NodeODM +++ b/nodeodm/external/NodeODM @@ -1 +1 @@ -Subproject commit bcbec55c039b02c068da18da466f268d1baa1fce +Subproject commit d0e1e1424e90c21fee401ce6e5a7dd1de7b32112 diff --git a/nodeodm/tests.py b/nodeodm/tests.py index 8f7f2b6f..7ae2a1be 100644 --- a/nodeodm/tests.py +++ b/nodeodm/tests.py @@ -45,7 +45,7 @@ class TestClientApi(TestCase): info = self.api_client.info() self.assertTrue(isinstance(info['version'], six.string_types), "Found version string") self.assertTrue(isinstance(info['taskQueueCount'], int), "Found task queue count") - self.assertTrue(isinstance(info['maxImages'], int), "Found task max images") + self.assertTrue(info['maxImages'] is None, "Found task max images") def test_options(self): options = self.api_client.options() @@ -62,7 +62,7 @@ class TestClientApi(TestCase): self.assertTrue(online_node.last_refreshed is not None, "Last refreshed is set") self.assertTrue(len(online_node.available_options) > 0, "Available options are set") self.assertTrue(online_node.api_version != "", "API version is set") - self.assertTrue(online_node.max_images > 0, "Max images is set") + self.assertTrue(online_node.max_images is None, "No max images limit is set") self.assertTrue(isinstance(online_node.get_available_options_json(), six.string_types), "Available options json works") self.assertTrue(isinstance(online_node.get_available_options_json(pretty=True), six.string_types), "Available options json works with pretty")