Explorar o código

Events are now transient by default

Ask Solem %!s(int64=10) %!d(string=hai) anos
pai
achega
8c56d52785
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      celery/events/__init__.py

+ 3 - 1
celery/events/__init__.py

@@ -124,7 +124,7 @@ class EventDispatcher(object):
 
     def __init__(self, connection=None, hostname=None, enabled=True,
                  channel=None, buffer_while_offline=True, app=None,
-                 serializer=None, groups=None):
+                 serializer=None, groups=None, delivery_mode=1):
         self.app = app_or_default(app or self.app)
         self.connection = connection
         self.channel = channel
@@ -139,6 +139,7 @@ class EventDispatcher(object):
         self.groups = set(groups or [])
         self.tzoffset = [-time.timezone, -time.altzone]
         self.clock = self.app.clock
+        self.delivery_mode = delivery_mode
         if not connection and channel:
             self.connection = channel.connection.client
         self.enabled = enabled
@@ -213,6 +214,7 @@ class EventDispatcher(object):
                 declare=[exchange],
                 serializer=self.serializer,
                 headers=self.headers,
+                delivery_mode=self.delivery_mode,
             )
 
     def send(self, type, blind=False, **fields):