code improvements
This commit is contained in:
parent
281aca4fe5
commit
9ef26594b6
|
|
@ -20,7 +20,7 @@ class Command(BaseCommand):
|
|||
)
|
||||
|
||||
def handle(self, *args, **kwargs):
|
||||
bucket_size = kwargs.pop('bucket_size') if kwargs.get('bucket_size') else 128
|
||||
bucket_size = kwargs.get('bucket_size', 128)
|
||||
|
||||
objects = Establishment.objects.all()
|
||||
objects_size = objects.count()
|
||||
|
|
@ -43,4 +43,4 @@ class Command(BaseCommand):
|
|||
job = group(*tasks)
|
||||
job.delay()
|
||||
|
||||
self.stdout.write(self.style.WARNING(f'Done all celery update tasks.\n'))
|
||||
self.stdout.write(self.style.SUCCESS(f'Done all celery update tasks.\n'))
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ from celery.task import periodic_task
|
|||
from django_elasticsearch_dsl.registries import registry
|
||||
|
||||
from establishment import models
|
||||
from establishment.models import Establishment
|
||||
from location.models import Country
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -53,7 +52,7 @@ def recalculation_public_mark(establishment_id):
|
|||
|
||||
@shared_task
|
||||
def update_establishment_image_urls(part_number: int, summary_tasks: int, bucket_ids: list):
|
||||
queryset = Establishment.objects.filter(id__in=bucket_ids)
|
||||
queryset = models.Establishment.objects.filter(id__in=bucket_ids)
|
||||
|
||||
for establishment in queryset:
|
||||
live_link = None
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user