def __call__(self, *args, **kw): applogger.debug("schedSafe: begin") hub.threadingLocal = threading_local() hub.begin() try: ret = self.f(*args, **kw) applogger.debug("schedSafe: %s returned %s" % (self.f.__name__, ret)) finally: commit_all() end_all() applogger.debug("schedSafe: done")
def before_finalize(self): database.commit_all()