Selaa lähdekoodia

Update grace time, scheduler shutdown

JoostSijm 5 vuotta sitten
vanhempi
commit
9bf7938bce
2 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 2 1
      app/__init__.py
  2. 1 0
      app/__main__.py

+ 2 - 1
app/__init__.py

@@ -19,7 +19,8 @@ Session = sessionmaker(bind=engine)
 
 # scheduler
 scheduler = BackgroundScheduler(
-    job_defaults={'misfire_grace_time': 15*60},
+    daemon=True,
+    job_defaults={'misfire_grace_time': 10*60},
 )
 scheduler.start()
 

+ 1 - 0
app/__main__.py

@@ -121,4 +121,5 @@ if __name__ == '__main__':
             time.sleep(100)
     except KeyboardInterrupt:
         print('Exiting application')
+        scheduler.shutdown()
         exit()