MCPcopy
hub / github.com/celery/celery / store_success_then_reject

Function store_success_then_reject

t/integration/tasks.py:526–535  ·  view source on GitHub ↗

First delivery: store SUCCESS manually, then Reject to trigger redelivery. Second delivery: dedup finds SUCCESS, dispatches chain.

(self)

Source from the content-addressed store, hash-verified

524
525@shared_task(bind=True, acks_late=True)
526def store_success_then_reject(self):
527 """First delivery: store SUCCESS manually, then Reject to trigger redelivery.
528 Second delivery: dedup finds SUCCESS, dispatches chain."""
529 from celery.backends.base import states
530 if not self.request.delivery_info.get('redelivered'):
531 self.backend.store_result(self.request.id, 'first-pass', states.SUCCESS)
532 raise Reject(requeue=True)
533 # When dedup is enabled the fast-path intercepts before reaching here,
534 # so 'dedup-pass' is only returned when dedup is disabled.
535 return 'dedup-pass'
536
537
538@shared_task(bind=True, acks_late=True)

Callers

nothing calls this directly

Calls 3

RejectClass · 0.90
getMethod · 0.45
store_resultMethod · 0.45

Tested by

no test coverage detected