David 4 miesięcy temu
rodzic
commit
898918f9fd
2 zmienionych plików z 20 dodań i 21 usunięć
  1. 0 2
      cache/clocking.py
  2. 20 19
      forecast_ust.py

+ 0 - 2
cache/clocking.py

@@ -97,8 +97,6 @@ class Clock(object):
             self.repairing_model(day_start_db, coe_start)
             self.opt.authentication['repair'] = self.opt.authentication['date']
             self.args.save_args_yml(self.opt)
-            process_name = "forecast_ust"
-            os.system(f"pkill {process_name}")
         self.logger.info("------------进入测试集自动计算-------------")
         coe_start += pd.Timedelta(days=1)
         nwp, env, dq, rp, rp_his = self.material(coe_start, day_end)

+ 20 - 19
forecast_ust.py

@@ -175,22 +175,23 @@ def last_model_update():
         return {"model_status": 2, "time": repair_dt, "msg": "neu算法:修模正常"}
 
 if __name__ == "__main__":
-    current_path = os.path.dirname(__file__)
-    opt = args.parse_args_and_yaml()
-    gunicorn_config = {
-        'bind': '%s:%s' % ('0.0.0.0', str(opt.port)),
-        'certfile': current_path + '/ssl/server.pem',
-        'keyfile': current_path + '/ssl/server.key',
-        "check_config": True,
-        "worker_class": "gthread",
-        "workers": 1,
-        "threads": 2,
-        'timeout': 60,
-        "loglevel": "info",
-        "access_log_format": "gunicorn %(h)s - %(t)s - %(r)s - %(s)s - %(f)s",
-        "backlog": 30,
-    }
-    threading.Thread(target=clock.calculate_coe, args=(True,)).start()
-    # # 启动服务
-    # StandaloneApplication(app, options=gunicorn_config).run()
-    app.run(host='0.0.0.0', port=opt.port, debug=False, ssl_context=(current_path + '/ssl/server.pem', current_path + '/ssl/server.key'))
+    # current_path = os.path.dirname(__file__)
+    # opt = args.parse_args_and_yaml()
+    # gunicorn_config = {
+    #     'bind': '%s:%s' % ('0.0.0.0', str(opt.port)),
+    #     'certfile': current_path + '/ssl/server.pem',
+    #     'keyfile': current_path + '/ssl/server.key',
+    #     "check_config": True,
+    #     "worker_class": "gthread",
+    #     "workers": 1,
+    #     "threads": 2,
+    #     'timeout': 60,
+    #     "loglevel": "info",
+    #     "access_log_format": "gunicorn %(h)s - %(t)s - %(r)s - %(s)s - %(f)s",
+    #     "backlog": 30,
+    # }
+    # threading.Thread(target=clock.calculate_coe, args=(True,)).start()
+    # # # 启动服务
+    # app.run(host='0.0.0.0', port=opt.port, debug=False, ssl_context=(current_path + '/ssl/server.pem', current_path + '/ssl/server.key'))
+
+    clock.calculate_coe(True)