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.
This commit is contained in:
parent
f01390eb5c
commit
6ba838f770
1 changed files with 2 additions and 2 deletions
|
@ -8,7 +8,7 @@ class Command(BaseCommand):
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
for original_image in OriginalImage.objects.all():
|
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():
|
for original_video in OriginalVideo.objects.all():
|
||||||
create_video_resolutions(original_video)
|
create_video_resolutions.delay(original_video.id)
|
Loading…
Reference in a new issue