0

I've installed Flower via pip, all work's fine, but when i see task time in flower it show me GMT time instead time in timezone. Flower task options

  • Pythnon - 3.4
  • Django - 1.8.7
  • Redis server v=2.8.17
  • Celery - 3.1.19

My celery and django conf:

TIME_ZONE = 'Europe/Moscow'
USE_I18N = True
USE_L10N = True
USE_TZ = True
CELERY_ENABLE_UTC = True
CELERY_TIMEZONE = 'Europe/Moscow'

I've tried to change TIME_ZONE but it gives nothing, or set CELERY_ENABLE_UTS = False If i change celery timezone properties - it's changed in workers log. HW time on server is 13:52 too.

In the worker log time is displayed correctly.

[2016-01-13 13:52:44,510: INFO/MainProcess] Received task: ***task[f652c89d-3f1b-4795-9e41-064ceb33b462]
[2016-01-13 13:52:45,529: INFO/MainProcess] Task ***task[f652c89d-3f1b-4795-9e41-064ceb33b462] succeeded in 1.0084812670002066s:

2 Answers2

0

setting CELERY_ENABLE_UTC = False, if your celery version is higher than 3.0 , so that keep same with celery beat and works well for all schedules.

CELERY_ENABLE_UTC = False

setting CELERY_TIMEZONE = 'Asia/Shanghai'. so that flower time display well.

CELERY_TIMEZONE = 'Asia/Shanghai'

in Flask, settings should be push into conf obj by: celery.conf['CELERY_ENABLE_UTC'] = CELERY_ENABLE_UTC celery.conf['CELERY_TIMEZONE'] = CELERY_TIMEZONE

fandyst
  • 2,740
  • 2
  • 14
  • 15
0

Settings.py

CELERY_TIMEZONE = 'Asia/Kolkata'
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'Asia/Kolkata'
USE_TZ = True

Worker+ BEAT

celery -A APP_NAME worker --pool=prefork --concurrency=5 --autoscale=10,1 --beat -l info

Flower With Redis broker

celery -A APP_NAME --broker=redis://127.0.0.1:6379 flower --address=127.0.0.1 --port=5555

Worker Celery Worker task Screenshot

Flower Flower Task Screenshot

abhishek Singh
  • 332
  • 2
  • 7