forked from rachelos/we-mp-rss
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
23 lines (23 loc) · 817 Bytes
/
Copy pathmain.py
File metadata and controls
23 lines (23 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import uvicorn
from core.config import cfg
from core.print import print_warning
import threading
if __name__ == '__main__':
if cfg.args.init=="True":
import init_sys as init
init.init()
if cfg.args.job =="True" and cfg.get("server.enable_job",False):
from jobs import start_all_task
threading.Thread(target=start_all_task,daemon=False).start()
else:
print_warning("未开启定时任务")
print("启动服务器")
AutoReload=cfg.get("server.auto_reload",False)
thread=cfg.get("server.threads",1)
uvicorn.run("web:app", host="0.0.0.0", port=int(cfg.get("port",8001)),
reload=AutoReload,
reload_dirs=['core','web_ui'],
reload_excludes=['static','web_ui','data'],
workers=thread,
)
pass