加点小延迟

This commit is contained in:
Jerry Yan 2019-12-04 10:12:16 +08:00
parent 53bda4d853
commit 65be98f6b8
2 changed files with 6 additions and 5 deletions

2
api.py
View File

@ -236,7 +236,7 @@ class XiGuaLiveApi:
更新房间信息 更新房间信息
:return: :return:
""" """
if not force and self._updRoomAt > (datetime.now() - timedelta(minutes=2)): if not force and self._updRoomAt > (datetime.now() - timedelta(minutes=3)):
return self.isLive return self.isLive
self._updRoomAt = datetime.now() self._updRoomAt = datetime.now()
if self.isLive: if self.isLive:

View File

@ -8,7 +8,6 @@ import os
import requests import requests
def download(): def download():
session = requests.session() session = requests.session()
while Common.api.isLive and not Common.forceNotDownload: while Common.api.isLive and not Common.forceNotDownload:
@ -56,7 +55,7 @@ def encode():
def upload(): def upload():
date=datetime.strftime(datetime.now(), "%Y_%m_%d") date = datetime.strftime(datetime.now(), "%Y_%m_%d")
Common.appendUploadStatus("Upload Daemon Starting") Common.appendUploadStatus("Upload Daemon Starting")
i = Common.uploadQueue.get() i = Common.uploadQueue.get()
while True: while True:
@ -126,9 +125,9 @@ def run():
Common.api.updRoomInfo() Common.api.updRoomInfo()
except Exception as e: except Exception as e:
Common.appendError(e.__str__()) Common.appendError(e.__str__())
time.sleep(5) time.sleep(2)
continue continue
time.sleep(1) time.sleep(0.5)
else: else:
try: try:
Common.api.updRoomInfo() Common.api.updRoomInfo()
@ -145,4 +144,6 @@ def run():
Common.forceStartUploadThread = False Common.forceStartUploadThread = False
if Common.doDelay(): if Common.doDelay():
Common.uploadQueue.put(True) Common.uploadQueue.put(True)
isEncode = True
isUpload = True
time.sleep(5) time.sleep(5)