Exemple #1
0
    def _dispatch_deferred_task(self):
        self._kwargs['signal_pk'] = self.signal.pk

        if SIGNAL_DEFERRED_DISPATCHER == 'celery':
            from dbmail import tasks

            tasks.deferred_signal.apply_async(
                args=[self.sender],
                kwargs=self._kwargs,
                default_retry_delay=SEND_RETRY_DELAY,
                max_retries=SEND_RETRY,
                queue=SIGNALS_QUEUE,
                countdown=self.signal.interval)
        else:
            SignalDeferredDispatch.add_task(
                args=[self.sender],
                kwargs=self._kwargs,
                params=dict(default_retry_delay=SEND_RETRY_DELAY,
                            max_retries=SEND_RETRY,
                            queue=SIGNALS_QUEUE),
                interval=self.signal.interval)
Exemple #2
0
    def _dispatch_deferred_task(self):
        self._kwargs['signal_pk'] = self.signal.pk

        if SIGNAL_DEFERRED_DISPATCHER == 'celery':
            from dbmail import tasks

            tasks.deferred_signal.apply_async(
                args=[self.sender], kwargs=self._kwargs,
                default_retry_delay=SEND_RETRY_DELAY,
                max_retries=SEND_RETRY,
                queue=SIGNALS_QUEUE,
                countdown=self.signal.interval
            )
        else:
            SignalDeferredDispatch.add_task(
                args=[self.sender], kwargs=self._kwargs,
                params=dict(
                    default_retry_delay=SEND_RETRY_DELAY,
                    max_retries=SEND_RETRY,
                    queue=SIGNALS_QUEUE
                ), interval=self.signal.interval
            )