Skip to content

Commit

Permalink
run celery scheduler (beat) separately so concurrency doesn't create …
Browse files Browse the repository at this point in the history
…duplicate tasks, decrease logging sizes
  • Loading branch information
lardbit committed Apr 10, 2024
1 parent cb33580 commit ee2c4fd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions entrypoint-celery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ if [ ! -z $CELERY_BEAT_SEPARATELY ]; then
else
su $(id -un ${RUN_AS_UID}) -c "/env/bin/celery -A nefarious worker --concurrency ${NUM_CELERY_WORKERS:-0} --loglevel=INFO"
fi
# run celery worker & scheduler at the same time, with single concurrency
# run celery worker & scheduler at the same time
# NOTE: this isn't advised since the scheduler could be potentially running multiple/simultaneous times creating duplicate tasks
else
su $(id -un ${RUN_AS_UID}) -c "/env/bin/celery -A nefarious worker --concurrency 1 --beat --loglevel=INFO"
su $(id -un ${RUN_AS_UID}) -c "/env/bin/celery -A nefarious worker --concurrency ${NUM_CELERY_WORKERS:-0} --beat --loglevel=INFO"
fi

0 comments on commit ee2c4fd

Please sign in to comment.