提交 23640138 authored 作者: blu's avatar blu

evdameon, evcloudsvc: subsystem monitor thread and defered uploading

上级 99790eb1
import requests, glob, os, json, socket
import requests, glob, os, json, socket, datetime
FILE_PATH = os.getenv('FILE_PATH', '/var/data/evsuits/failed_events')
API_ADDR=os.getenv('API_ADDR', 'http://evcloudsvc.ilabservice.cloud:10009/upload/evtvideos/')
......@@ -52,6 +52,11 @@ if __name__ == "__main__":
s.bind(('localhost', 45431))
files = list_files(FILE_PATH)
for f in files:
now = datetime.datetime.now().timestamp()
mts = os.path.getmtime(f)
# defer those files may still in recording
if now - mts < 35:
continue
res = upload_file(f)
if res:
continue
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论