Beispiel #1
0
 def __init__(self, interval=(24 * 60 * 60)):
     cleanup = synchronous(transactional(cleanup_old_nonces))
     super().__init__(interval, deferToDatabase, cleanup)
Beispiel #2
0
 def new_deferToThreadPool(reactor, threadpool, f, *args, **kwargs):
     """Variant of Twisted's that wraps all functions in `synchronous`."""
     func = f if ISynchronous.providedBy(f) else synchronous(f)
     return deferToThreadPool(reactor, threadpool, func, *args, **kwargs)