diff --git a/birb_scheduler/main.py b/birb_scheduler/main.py index 119c0bf..e3f9138 100644 --- a/birb_scheduler/main.py +++ b/birb_scheduler/main.py @@ -8,9 +8,7 @@ from sentry_sdk.integrations.logging import LoggingIntegration from config import Config from apscheduler.schedulers.blocking import BlockingScheduler - -def run(): - logging.info("Csirip") +from run_scheduler import run def main(): @@ -38,7 +36,12 @@ def main(): scheduler = BlockingScheduler() scheduler.add_job(run, trigger='interval', seconds=Config.INTERVAL) - scheduler.start() + try: + scheduler.start() + except KeyboardInterrupt: + pass + + scheduler.shutdown() if __name__ == '__main__': diff --git a/birb_scheduler/run_scheduler.py b/birb_scheduler/run_scheduler.py new file mode 100644 index 0000000..d7d052c --- /dev/null +++ b/birb_scheduler/run_scheduler.py @@ -0,0 +1,5 @@ +import logging + + +def run(): + logging.info("Csirip")