Esempio n. 1
0
async def startup():
    Default.init()
    config = Default.config.get_config(section='apiserver')
    _scheduler = config.get('scheduler', 'self')
    common.add(key='supervisor', value=Default.get_employee('supervisor'), destroy=destroy_supervisor)
    if isinstance(_scheduler, Scheduler):
        common.add(key='scheduler', value=_scheduler, destroy=destroy_scheduler)
        common.scheduler.start()
    elif isinstance(_scheduler, str):
        if _scheduler == 'self':
            common.add(key='scheduler', value=Default.get_scheduler(), destroy=destroy_scheduler)
            common.scheduler.start()
        else:
            common.add(key='scheduler', value=_scheduler)
Esempio n. 2
0
async def startup():
    Default.init()
    common.add(key='scheduler',
               value=Default.get_scheduler(),
               destroy=destroy_scheduler)
    common.scheduler.start()