Skip to content

Commit

Permalink
Merge pull request #1506 from diegoaces/master
Browse files Browse the repository at this point in the history
Fix #1505 add a signal to notify that we are resizing images
  • Loading branch information
pierotofy committed May 27, 2024
2 parents fa058e7 + a1bc968 commit 044e139
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/models/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions app/plugins/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])

0 comments on commit 044e139

Please sign in to comment.