Skip to content

Working with Celery on CourtListener

Mike Lissner edited this page Jun 27, 2023 · 1 revision

If you are working with celery tasks, it's helpful to use celery events which is a simple curses monitor displaying task and worker history, you can inspect the result and traceback of tasks, and it also supports some management commands like rate limiting and shutting down workers.

  1. First, you need to set CELERY_TASK_ALWAYS_EAGER to False under DEVELOPMENT Settings: cl.settings.third_party.celery, to allow running your task into the async worker: CELERY_TASK_ALWAYS_EAGER = False Remember to set it TRUE once debugging is finished, otherwise, tests aren't going to pass.

  2. To use celery events you need to run a celery worker that sends events, adding the -E option: docker exec -it cl-celery celery -A cl worker -c 1 -E

  3. Then start celery events monitor: docker exec -it cl-celery celery -A cl events Now, when executing a task you'll be able to monitor it with celery events.