celery/django-celery — pull request #331 by rockallite (2014-07-16 13:05:51+00:00)
Title: Fix WorkerState.is_alive() not accurate when settings.USE_TZ = True and ...

...the local timezone is not UTC.

If `USE_TZ` is set to True in Django's settings, the timestamp stored in the database should be in UTC. However, `WorkState.is_alive()` unconditionally uses a local timestamp to compare with the database timestamp, so it always returns True (or False) in certain timezones. As a result, worker states in admin interface are always "ONLINE" or "OFFLINE" in those timezones.

This PR fixes this problem by checking `django.conf.settings.USE_TZ`, and using a UTC timestamp to compare if it is True.