Explorar o código

Update grace time, scheduler shutdown

JoostSijm %!s(int64=5) %!d(string=hai) anos
pai
achega
9bf7938bce
Modificáronse 2 ficheiros con 3 adicións e 1 borrados
  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()