MCPcopy Create free account
hub / github.com/celery/celery / close

Method close

celery/beat.py:478–500  ·  view source on GitHub ↗

Sync and release publishing resources; subclasses close storage. The base publishing properties are recreated lazily on next access. Resuming a subclass may require reopening storage or reacquiring locks.

(self)

Source from the content-addressed store, hash-verified

476 pass
477
478 def close(self):
479 """Sync and release publishing resources; subclasses close storage.
480
481 The base publishing properties are recreated lazily on next access.
482 Resuming a subclass may require reopening storage or reacquiring locks.
483 """
484 sync_failed = True
485 try:
486 self.sync()
487 sync_failed = False
488 finally:
489 # Inspect the cache so closing an unused scheduler cannot open
490 # a broker connection. Releasing it also closes its channels.
491 self.__dict__.pop('producer', None)
492 connection = self.__dict__.pop('connection', None)
493 if connection is not None:
494 try:
495 ignore_errors(connection, connection.release)
496 except Exception:
497 if not sync_failed:
498 raise
499 error('beat: Connection cleanup failed after sync error',
500 exc_info=True)
501
502 def add(self, **kwargs):
503 entry = self.Entry(app=self.app, **kwargs)

Callers 4

mainFunction · 0.45
closeMethod · 0.45
syncMethod · 0.45

Calls 2

syncMethod · 0.95
popMethod · 0.45