防抖~~~~~~~~

最近主播老是掉线,避免误传(B站删稿件要2个硬币了TAT)
This commit is contained in:
Jerry Yan 2019-09-24 09:18:40 +08:00
parent a0824785e5
commit 2554b537e8

View File

@ -107,7 +107,6 @@ def upload():
continue
if not Common.forceNotEncode:
os.remove(i)
sleep(1800) # 防抖,避免主播因特殊情况下播导致直接投递了
i = Common.uploadQueue.get()
Common.appendUploadStatus("Upload Daemon Quiting")
@ -158,8 +157,10 @@ def run():
return
awakeEncode()
_count = 0
_firstDown = False
while True:
if Common.api.isLive and not Common.forceNotBroadcasting:
_firstDown = True
if not Common.forceNotDownload:
awakeDownload()
awakeUpload()
@ -175,8 +176,13 @@ def run():
continue
time.sleep(5)
else:
if _firstDown:
sleep(1800) # 防抖,避免主播因特殊情况下播导致直接投递了
_firstDown = False
continue
if not isEncode and not isDownload:
Common.uploadQueue.put(True)
_firstDown = False
isEncode = True
isDownload = True
time.sleep(60)