job_defaults = { 'coalesce': coalesce, 'max_instances': max_instances } scheduler = TwistedScheduler(timezone=local_tz) scheduler.add_jobstore( 'mongodb', host=MONGO_HOST_SELF, port=MONGO_PORT_SELF, collection=CORE_ID ) scheduler.add_executor( ThreadPoolExecutor(threadpool_executor), 'default' ) scheduler.add_executor( ProcessPoolExecutor(processpool_executor), 'processpool' ) scheduler.start() def job_logger(event): if event.code > 512: toLog('Job {}, code {}'.format( event.job_id, event_code_translator(event.code)), 'jobs') elif event > 64:
'default': ThreadPoolExecutor(threadpool_executor), 'processpool': ProcessPoolExecutor(processpool_executor) } job_defaults = {'coalesce': coalesce, 'max_instances': max_instances} scheduler = TwistedScheduler(timezone=local_tz) # scheduler.add_jobstore( # 'mongodb', # host=MONGO_HOST_SELF, # port=MONGO_PORT_SELF, # collection=CORE_ID # ) scheduler.add_executor(ThreadPoolExecutor(threadpool_executor), 'default') scheduler.add_executor(ProcessPoolExecutor(processpool_executor), 'processpool') scheduler.start() def job_logger(event): if event.code > 512: toLog( 'Job {}, code {}, run time {}, return value {}, exception {}'. format(event.job_id, event_code_translator(event.code), event.scheduled_run_time, event.retval, event.exception), 'jobs')