From 6ba838f770f1ddfd45b37e267e00f040ee776a71 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sun, 17 Mar 2024 13:48:00 +0100 Subject: [PATCH] feat: Asynchronous resolution processing Refactor the image and video resolution creation process to be asynchronous. This change optimizes performance by sending `original_image.id` and `original_video.id` to `create_image_resolutions.delay` and `create_video_resolutions.delay` respectively, rather than processing synchronously. This enhancement significantly improves the scalability of handling large sets of images and videos, ensuring system resources are utilized more efficiently and users experience less delay. --- quackscape/tours/management/commands/createresolutions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quackscape/tours/management/commands/createresolutions.py b/quackscape/tours/management/commands/createresolutions.py index 20f48c6..d24631f 100644 --- a/quackscape/tours/management/commands/createresolutions.py +++ b/quackscape/tours/management/commands/createresolutions.py @@ -8,7 +8,7 @@ class Command(BaseCommand): def handle(self, *args, **options): for original_image in OriginalImage.objects.all(): - create_image_resolutions(original_image) + create_image_resolutions.delay(original_image.id) for original_video in OriginalVideo.objects.all(): - create_video_resolutions(original_video) \ No newline at end of file + create_video_resolutions.delay(original_video.id) \ No newline at end of file