Browse Source

flask_app: 开启服务的定时任务

Signed-off-by: Binren Zhnag <zhangbr@elab-plus.com>
Binren Zhnag 5 years ago
parent
commit
60dcbbf044
1 changed files with 4 additions and 4 deletions
  1. 4 4
      flask_app.py

+ 4 - 4
flask_app.py

@@ -10,7 +10,7 @@ import decimal
 from report_push import ReportPush
 
 app = Flask(__name__)
-# app.config.from_object(Config())
+app.config.from_object(Config())
 
 
 @app.route('/score', methods=['GET', 'POST'])
@@ -246,9 +246,9 @@ class DecimalEncoder(json.JSONEncoder):
 
 
 if __name__ == '__main__':
-    # scheduler = APScheduler()
-    # scheduler.init_app(app)
-    # scheduler.start()
+    scheduler = APScheduler()
+    scheduler.init_app(app)
+    scheduler.start()
     app.run(
         host='0.0.0.0',
         port=5001