Autoreload Celery Workers in Dev

April 5th, 2024


watchmedo shell-command --patterns="*.py" --recursive --command='pkill -f celery; celery -A formendpoint.tasks.celery worker'

Big learnings for me was the watchdog library and the pkill -f command (the -f flag allows for full command matching). Very useful commands, gives me lots of (probably) terrible ideas about simple utilities that previous required OS X Automator.