This commit is contained in:
Ask Solem 2012-07-07 12:51:54 +01:00
Родитель f75c35595f
Коммит 9000f31d6f
3 изменённых файлов: 26 добавлений и 1 удалений

Просмотреть файл

@ -49,6 +49,8 @@ Time and date settings
CELERY_ENABLE_UTC
~~~~~~~~~~~~~~~~~
.. versionadded:: 2.5
If enabled dates and times in messages will be converted to use
the UTC timezone.
@ -56,7 +58,7 @@ Note that workers running Celery versions below 2.5 will assume a local
timezone for all messages, so only enable if all workers have been
upgraded.
Disabled by default. UTC will be enabled by default in version 4.0.
Enabled by default since version 3.0.
.. setting:: CELERY_TIMEZONE

Просмотреть файл

@ -629,6 +629,24 @@ and shows a list of online workers in the cluster::
You can read more about the :program:`celery` command and monitoring
in the :ref:`Monitoring Guide <guide-monitoring>`.
Timezone
========
All times and dates, internally and in messages uses the UTC timezone.
When the worker receives a message, for example with a countdown set it
converts that UTC time to local time. If you wish to use
a different timezone than the system timezone then you must
configure that using the :setting:`CELERY_TIMEZONE` setting.
To use custom timezones you also have to install the :mod:`pytz` library::
$ pip install pytz
Setting a custom timezone::
celery.conf.CELERY_TIMEZONE = 'Europe/London'
Optimization
============

Просмотреть файл

@ -5,3 +5,8 @@ from celery import Celery
celery = Celery(broker='amqp://',
backend='amqp://',
include=['proj.tasks'])
# Optional configuration, see the application user guide.
celery.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
)