|
@@ -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)
|