0

So, I have been using celery/beat for a number of years, and have been ofsetting manually, the schedule of my tasks due to DST issues etc. As my codebase has become larger, the script that I run to change the times is getting bigger and bigger, and I have decided to sort the problem out.

So in short, my system clock updates automatically, from my shell I can run:

┌─[luke@freebsd] - [~/py3-apps/intranet] - [Thu Mar 29, 12:24]
└─[$]> date
Thu Mar 29 12:37:22 BST 2018

So presently I have a task to run at 10:30am, it will run at 11:30am. So I thought this would be easy, I added the following to my configuration:

CELERY_TIMEZONE = Europe/London
CELERY_ENABLE_UTC = False

When I run my celery beat schedule, via:

celery worker --beat -A pyramid_celery.celery_app --ini development.ini -n celeryIntranetAPI

Now I thought this would solve my problems, however my cron tasks are still an hour behind, how can I make celery keep up with the system clock?

Note I have tried:

CELERY_TIMEZONE = UTC          
CELERY_ENABLE_UTC = True

As per a few suggestions, but this did not work either.

Can anyone can shed some light on how I can link my celery cron timings to the system clock?

This was fixed in celery here: https://github.com/celery/celery/commit/be55de622381816d087993f1c7f9afcf7f44ab33

crooksey
  • 8,521
  • 6
  • 30
  • 52
  • that you're using `CELERY_` I assume you are importing it in a celery configuration file? If not you can just use `TIMEZONE`, depending on where you live, London is 1 hour behind on the rest of Europe. `UTC` is being used automatically. I think `UTC-1` is also an option? But I'm not sure. Hope this helps you out. Another option would be to add `app.conf.timezone = 'UTC'` in the celery configuration file. – King Reload Apr 04 '18 at 13:06
  • Turns out I wasn't going mad, this was a celery issue: https://github.com/celery/celery/commit/be55de622381816d087993f1c7f9afcf7f44ab33 – crooksey Apr 05 '18 at 08:42
  • problem solved then? – King Reload Apr 05 '18 at 08:43
  • Yea, crashed out so just marked, thanks for the help. – crooksey Apr 05 '18 at 09:36

1 Answers1

0

Turns out this was a bug with celery, fixed here

crooksey
  • 8,521
  • 6
  • 30
  • 52