diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 5c8941f..df06221 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -167,7 +167,7 @@ case "$1" in wait_for_postgres wait_for_redis echo "Starting Celery Worker..." - exec celery -A myproject worker \ + exec celery -A myproject.celery:app worker \ -l info \ -Q celery,photo_processing \ --concurrency=2 diff --git a/myproject/myproject/__init__.py b/myproject/myproject/__init__.py index 9b9979b..c8c70ba 100644 --- a/myproject/myproject/__init__.py +++ b/myproject/myproject/__init__.py @@ -1,8 +1,6 @@ """ -=8F80;870F8O Celery 4;O 02B><0B8G5A:>9 703@C7:8 ?@8 AB0@B5 Django. - --B> 30@0=B8@C5B GB> Celery app 1C45B 8=8F80;878@>20= 2 <><5=B 70?CA:0 Django, -GB> ?>72>;O5B @shared_task 45:>@0B>@C @01>B0BL ?@028;L=>. +Celery configuration. +This ensures the Celery app is loaded when Django starts. """ from .celery import app as celery_app diff --git a/myproject/products/utils/image_service.py b/myproject/products/utils/image_service.py index 67a9fdd..d69a248 100644 --- a/myproject/products/utils/image_service.py +++ b/myproject/products/utils/image_service.py @@ -73,7 +73,12 @@ class ImageService: parts = path_str.split('/') if len(parts) < 3: - return '' + return default_storage.url(path_str) + + # Если изображение во временной папке (еще не обработано) + # Возвращаем оригинал, так как других размеров еще нет + if 'temp' in parts: + return default_storage.url(path_str) # Извлекаем base_path, entity_id, photo_id из пути base_path = parts[0] # products, kits, categories