def __init__(self, interval=(24 * 60 * 60)): cleanup = synchronous(transactional(cleanup_old_nonces)) super().__init__(interval, deferToDatabase, cleanup)
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)