fire job on start using scheduler

This commit is contained in:
vy.boyko 2024-10-17 18:20:52 +03:00
parent 8f0db93779
commit fd54f2497f

View File

@ -49,10 +49,9 @@ def _do_fetch():
fetch(settings=settings, args=args) fetch(settings=settings, args=args)
def _start_scheduling(): def _start_scheduling():
logger.info("Fetching on start")
_do_fetch()
logger.info('Setting Scheduler up') logger.info('Setting Scheduler up')
schedule = Scheduler() schedule = Scheduler()
schedule.once(dt.timedelta(seconds=5), _do_fetch)
schedule.cyclic(dt.timedelta(seconds=args.check_interval*60), _do_fetch) schedule.cyclic(dt.timedelta(seconds=args.check_interval*60), _do_fetch)
logger.info(schedule) logger.info(schedule)
while True: while True: