非同期タスクとスケジュール タスクの 2 種類のタスクがあります。だから、ここに私のディレクトリ構造があります:
proj
|
-- tasks
|
-- __init__.py
|
-- celeryapp.py => celery instance defined in this file.
|
-- celeryconfig.py
|
-- async
| |
| -- __init__.py
| |
| -- task1.py => from proj.tasks.celeryapp import celery
| |
| -- task2.py => from proj.tasks.celeryapp import celery
|
-- schedule
|
-- __init__.py
|
-- task1.py => from proj.tasks.celeryapp import celery
|
-- task2.py => from proj.tasks.celeryapp import celery
しかし、以下のように celery worker を実行すると動作しません。セロリビートスケジューラからのタスクを受け付けることができません。
$ celery worker --app=tasks -Q my_queue,default_queue
では、複数のタスク ファイルの編成に関するベスト プラクティスはありますか?