sibson / redbeat

RedBeat is a Celery Beat Scheduler that stores the scheduled tasks and runtime metadata in Redis.
Apache License 2.0
918 stars 130 forks source link

Timezone doesn't run tasks #152

Open arbazkiraak opened 4 years ago

arbazkiraak commented 4 years ago
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'Asia/Kolkata'
USE_I18N = True
USE_L10N = True
USE_TZ = True

CELERY_BROKER_URL = 'redis://localhost:6379'
CELERY_RESULT_BACKEND =  CELERY_BROKER_URL
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_REDBEAT_REDIS_URL = 'redis://localhost:6379/1'
CELERY_ENABLED_UTC = False
CELERY_TIMEZONE = 'Asia/Kolkata'
CELERYBEAT_MAX_LOOP_INTERVAL = 1  # redbeat likes fast loops ## keep it 5
CELERYBEAT_SCHEDULER = 'redbeat.RedBeatScheduler'
CELERY_TASK_SOFT_TIME_LIMIT = 14400
CELERY_TASK_TIME_LIMIT = 14420
interval_c = celery.schedules.schedule(run_every=20)  # seconds
entry = RedBeatSchedulerEntry('demo_task','mainapp.tasks.Demo_Task_Run', interval_c, args=["arbaz"],options={'queue':'mainqueue'},app=app)
entry.save()
print(entry.key)

As soon as I run the scheduler task gets executed for once only and it won't repeat, this behavior is applicable on setting a CELERY_TIMEZONE

arbazkiraak commented 4 years ago

tasks run perfectly with UTC

arbazkiraak commented 4 years ago

→ pip3 freeze | grep "redbeat" celery-redbeat==0.13.0

→ pip3 freeze | grep "Django" Django==2.2.4

celery==4.4.0

chen-zhuohan commented 4 years ago

there are some conflict between celery==4.4 and celery-redbeat 0.13, detail: https://github.com/sibson/redbeat/issues/143