You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.2 KiB

1 year ago
from web import create_app
from core.ModelManager import mMM
1 year ago
import os
import platform
import shutil
import asyncio
from hypercorn.asyncio import serve
from hypercorn.config import Config
from myutils.MyTraceMalloc import MyTraceMalloc
import threading
1 year ago
print(f"Current working directory (run.py): {os.getcwd()}")
1 year ago
web = create_app()
async def run_quart_app():
config = Config()
config.bind = ["0.0.0.0:5001"]
await serve(web, config)
def test():
mMM.test1()
1 year ago
if __name__ == '__main__':
#test()
system = platform.system()
if system == "Windows":
total, used, free = shutil.disk_usage("/")
elif system == "Linux":
"""获取Linux系统的剩余存储空间"""
statvfs = os.statvfs(os.getcwd())
free = statvfs.f_bavail * statvfs.f_frsize
else:
raise NotImplementedError(f"Unsupported operating system: {system}")
print(free/(1024*1024))
# #内存监控线程
# myTM = MyTraceMalloc()
# threading.Thread(target=myTM.trace_memory, daemon=True).start()
#启动工作线程
mMM.start_work() # 启动所有通道的处理
#mVManager.start_check_rtsp() #线程更新视频在线情况
#启动web服务
asyncio.run(run_quart_app())
1 year ago