From 8dd27fb82c1801a2e2bc66dc809a07caeb7c15d6 Mon Sep 17 00:00:00 2001 From: Frank Hamand Date: Thu, 9 Feb 2017 12:19:40 +0000 Subject: [PATCH] Fix all workers running beats This caused inaccurate timings and some duplicate jobs running. There should only ever be a single beat service, whereas we were using a dev feature to run a beat service on all 16 workers --- Procfile | 3 ++- Procfile.dev | 3 ++- docker-compose.yml | 13 ++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Procfile b/Procfile index dd7772a..dc603d7 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1,3 @@ web: gunicorn cabot.wsgi:application --config gunicorn.conf -celery: celery worker -B -A cabot --loglevel=INFO --concurrency=16 -Ofair +celery: celery worker -A cabot --loglevel=INFO --concurrency=16 -Ofair +beat: celery beat -A cabot --loglevel=INFO diff --git a/Procfile.dev b/Procfile.dev index b23ff01..d3cecc0 100644 --- a/Procfile.dev +++ b/Procfile.dev @@ -1,2 +1,3 @@ web: python manage.py runserver 0.0.0.0:$PORT -celery: celery -A cabot worker --loglevel=DEBUG -B -c 8 -Ofair +celery: celery -A cabot worker --loglevel=DEBUG -c 8 -Ofair +beat: celery -A cabot beat --loglevel=DEBUG diff --git a/docker-compose.yml b/docker-compose.yml index d846d58..14149ad 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,7 +18,18 @@ services: env_file: - conf/development.env image: cabot:web - command: python manage.py celery worker -B -A cabot --loglevel=DEBUG --concurrency=16 -Ofair + command: python manage.py celery worker -A cabot --loglevel=DEBUG --concurrency=16 -Ofair + volumes: + - .:/code + links: + - redis + - db + + beat: + env_file: + - conf/development.env + image: cabot:web + command: python manage.py celery beat -A cabot --loglevel=DEBUG volumes: - .:/code links: