django-celery icon indicating copy to clipboard operation
django-celery copied to clipboard

Although USE_TZ and CELERY_ENABLE_UTC are set to false, scheduler triggers the task 3 hours before from the current time.

Open ahmetonol opened this issue 9 years ago • 3 comments

Works fine in development mode.

Timezones in Django and Celery are set to false

USE_TZ = False
CELERY_ENABLE_UTC = False

My server timezone is EEST Tue Sep 20 16:58:01 EEST 2016 Worker are run as a daemon Here are the celerybeat and celeryd.

# celerybeat
# Where the Django project is.
CELERYBEAT_CHDIR="/var/www/api-test/"

# Name of the projects settings module.
export DJANGO_SETTINGS_MODULE="api.settings"

# Path to celerybeat
CELERYBEAT="$ENV_PYTHON $CELERYBEAT_CHDIR/manage.py celerybeat"

# Extra arguments to celerybeat
CELERYBEAT_OPTS="-S djcelery.schedulers.DatabaseScheduler"

ENV_PYTHON="/var/www/api/bin/python"
CELERYBEAT_LOG_FILE="/var/www/api-test/celerybeat.log"
CELERYBEAT_PID_FILE="/var/www/api-test/celerybeat.pid"

CELERYBEAT_USER="user"
CELERYBEAT_GROUP="users"
# celeryd
# Name of nodes to start, here we have a single node
# CELERYD_NODES="w1"
# or we could have three nodes:
#CELERYD_NODES="w1 w2 w3"

# Where to chdir at start.
CELERYD_CHDIR="/var/www/api-test"

# Python interpreter from environment.
ENV_PYTHON="/var/www/api/bin/python"

# CELERY_APP ="turboard.celery"

# How to call "manage.py celeryd_multi"
CELERYD_MULTI="$ENV_PYTHON $CELERYD_CHDIR/manage.py celeryd_multi"

# How to call "manage.py celeryctl"
# CELERYCTL="$ENV_PYTHON $CELERYD_CHDIR/manage.py celeryctl"

# Extra arguments to celeryd
CELERYD_OPTS="-A turboard.celery"

# Name of the celery config module.
# CELERY_CONFIG_MODULE="celeryconfig"

# %n will be replaced with the nodename.
CELERYD_PID_FILE="/var/www/api-test/%n.pid"
CELERYD_LOG_FILE="/var/www/api-test/%n.log"

# Workers should run as an unprivileged user.
CELERYD_USER="user"
CELERYD_GROUP="users"

# Name of the projects settings module.
export DJANGO_SETTINGS_MODULE="api.settings"

#CELERYD_LOG_LEVEL="DEBUG"

I created a periodic task, scheduled at 16:00 but I has never worked. If I change hour 16 to 13, It works properly.

Here is the periodic task change page:

screen shot 2016-09-20 at 16 42 08

Why do I need to set the time of periodic task 3 hours before from the current hour to run task at current time?

(Tested in Ubuntu Server 16.04 and 14.04)

ahmetonol avatar Sep 20 '16 14:09 ahmetonol

I could not reproduce the issue with current master. Can you post the versions of django, celery and django-celery you use?

vytisb avatar Sep 23 '16 17:09 vytisb

django: 1.9.6 celery: 3.1.23 django-celery: 3.1.17

ahmetonol avatar Oct 04 '16 11:10 ahmetonol

you need to install master branch

auvipy avatar Oct 04 '16 12:10 auvipy