def construct_system_log(system_log_address): syslog = SystemLog() syslog.for_all.before(lambda ctxt: ModelMeta.session_start()) syslog.for_all.after(lambda ctxt: ModelMeta.session_end()) Executor(syslog, system_log_address).run()
def construct_scheduler(tasks_address, scheduler_address): scheduler = wscheduler.Scheduler(Client(tasks_address)) scheduler_executor = Executor(scheduler, scheduler_address) scheduler.for_all.before(lambda ctxt: ModelMeta.session_start()) scheduler.for_all.after(lambda ctxt: ModelMeta.session_end()) Executor(scheduler, scheduler_address).run()
def start_solar_session(task_id, task, *args, **kwargs): ModelMeta.session_start()
def wrap_session(extension, clients): log.debug('DB session for %r', extension) extension.for_all.before(lambda ctxt: ModelMeta.session_start()) extension.for_all.after(lambda ctxt: ModelMeta.session_end())