From a1bc968a022acd1deb7f19500dec87a2eb11095d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Acu=C3=B1a?= <45692265+diegoaces@users.noreply.github.com> Date: Mon, 27 May 2024 11:19:49 -0400 Subject: [PATCH] Fix #1505 add a signal to notify that we are resizing images --- app/models/task.py | 3 +++ app/plugins/signals.py | 1 + 2 files changed, 4 insertions(+) diff --git a/app/models/task.py b/app/models/task.py index 7b369893d..0a9b6935c 100644 --- a/app/models/task.py +++ b/app/models/task.py @@ -1084,6 +1084,9 @@ def resize_images(self): if self.resize_to < 0: logger.warning("We were asked to resize images to {}, this might be an error.".format(self.resize_to)) return [] + # Add a signal to notify that we are resizing images + from app.plugins import signals as plugin_signals + plugin_signals.task_resizing_images.send_robust(sender=self.__class__, task_id=self.id) images_path = self.find_all_files_matching(r'.*\.(jpe?g|tiff?)$') total_images = len(images_path) diff --git a/app/plugins/signals.py b/app/plugins/signals.py index 0f1701c37..cf7494c28 100644 --- a/app/plugins/signals.py +++ b/app/plugins/signals.py @@ -4,5 +4,6 @@ task_removing = django.dispatch.Signal(providing_args=["task_id"]) task_removed = django.dispatch.Signal(providing_args=["task_id"]) task_failed = django.dispatch.Signal(providing_args=["task_id"]) +task_resizing_images = django.dispatch.Signal(providing_args=["task_id"]) processing_node_removed = django.dispatch.Signal(providing_args=["processing_node_id"])