@solovey1

Почему Celery Beat отправляет несколько задач, но выполняется только одна?

Прошу помощи с проблемой в Celery, у меня запланированы несколько задач в Celery Beat, но выполняется только одна задача (notify_after_sobes). В логах Celery Beat я вижу, что все задачи распознаны
[2023-12-07 14:56:00,042] celery.beat INFO Scheduler: Sending due task send_sobes_link (celery_settings.tasks.notify_send_sobes_link)
[2023-12-07 14:56:00,042] celery.beat INFO Scheduler: Sending due task after_sobes (celery_settings.tasks.notify_after_sobes)


Вот пример моей конфигурации:
app = Celery('tasks')
app.config_from_object(celeryconfig)


app.conf.beat_schedule = {
    'notify_tomorrow_sobes_task': {
        'task': 'celery_settings.tasks.notify_tomorrow_sobes',
        'schedule': crontab(minute="00", hour="18"),
    },
    'send_sobes_link': {
        'task': 'celery_settings.tasks.notify_send_sobes_link',
        'schedule': crontab(minute="5"),
    },
    'after_sobes': {
        'task': 'celery_settings.tasks.notify_after_sobes',
        'schedule': crontab(minute="5"),
    },
}
app.autodiscover_tasks()

@app.task
def notify_tomorrow_sobes():
    asyncio.run(send_notify_tomorrow_sobes())

@app.task
def notify_send_sobes_link():
    asyncio.run(send_sobes_link())

@app.task
def notify_after_sobes():
    asyncio.run(after_sobes())


Вторая задача (notify_send_sobes_link) завершается с ошибкой: NotRegistered('celery_settings.tasks.notify_send_sobes_link').

P9cE8.png
  • Вопрос задан
  • 109 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы