Просмотр исходного кода

All events now include a 'tzoffset' field that is a tuple of (stdoffset, dstoffset)

Ask Solem 12 лет назад
Родитель
Сommit
14cf713439
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      celery/events/__init__.py

+ 3 - 1
celery/events/__init__.py

@@ -84,6 +84,7 @@ class EventDispatcher(object):
         self.serializer = serializer or self.app.conf.CELERY_EVENT_SERIALIZER
         self.on_enabled = set()
         self.on_disabled = set()
+        self.tzoffset = [-time.timezone, -time.altzone]
 
         self.enabled = enabled
         if not connection and channel:
@@ -128,7 +129,8 @@ class EventDispatcher(object):
         if self.enabled:
             with self.mutex:
                 event = Event(type, hostname=self.hostname,
-                                    clock=self.app.clock.forward(), **fields)
+                                    clock=self.app.clock.forward(),
+                                    tzoffset=self.tzoffset, **fields)
                 try:
                     self.publisher.publish(event,
                                            routing_key=type.replace('-', '.'))