Celery task is not started

I have 2 celery tasks with two workers (worker for each task)

docker-compose.yml -- https://pastebin.com/Ln9WgxTd

Problem - don't see logs and results of the periodic_check_urls I am calling periodic_check_urls via POST request, but don't see result of the function

I just see

nginx_1_ef8ec258f1c4    | 10.37.15.246 - - [05/Sep/2022:23:59:02 +0000] "POST /check_all_urls/ HTTP/1.1" 200 34 "-" "PostmanRuntime/7.26.8" "-"

settings.py

CELERY_BROKER_URL = os.environ.get("CELERY_BROKER", "redis://redis:6379/0")
CELERY_RESULT_BACKEND = os.environ.get("CELERY_BROKER", "redis://redis:6379/0")
CELERY_IMPORTS = ("core_app.celery",)

CELERY_ROUTES = {
    'parser_app.views.periodic_exctract_urls': {'queue': 'priority_queue'},
    'parser_app.views.periodic_check_all_urls': {'queue': 'normal_queue'},
}

CELERY_BEAT_SCHEDULE = {
      'fetch_yandex_urls': {
        'task': 'parser_app.views.periodic_exctract_urls',
        'schedule': crontab(minute='*/15'),
        'options': {'queue': 'priority_queue'}
    },  
}

views.py

@shared_task(name="parser_app.views.periodic_check_urls")
def periodic_check_urls(parsing_result_ids: List[int]):
    ...
    print("Log", flush=True) # don't see this log

@api_view(['POST'])
def periodic_check_all_urls(request):
    ...
    periodic_check_urls.delay(parsing_results_ids) # parsing_results_ids is a list of ints
Back to Top