修复忽略了30分钟内从新开播的可能

This commit is contained in:
root 2019-09-28 21:13:00 +08:00
parent 8f20250dee
commit 586ef37874

View File

@ -157,10 +157,10 @@ def run():
return return
awakeEncode() awakeEncode()
_count = 0 _count = 0
_firstDown = False _firstDown = 0
while True: while True:
if Common.api.isLive and not Common.forceNotBroadcasting: if Common.api.isLive and not Common.forceNotBroadcasting:
_firstDown = True _firstDown = 0
if not Common.forceNotDownload: if not Common.forceNotDownload:
awakeDownload() awakeDownload()
awakeUpload() awakeUpload()
@ -176,17 +176,6 @@ def run():
continue continue
time.sleep(5) time.sleep(5)
else: else:
if not isEncode and not isDownload:
if _firstDown:
sleep(1800) # 防抖,避免主播因特殊情况下播导致直接投递了
Common.api.updRoomInfo()
_firstDown = False
continue
Common.uploadQueue.put(True)
_firstDown = False
isEncode = True
isDownload = True
time.sleep(60)
try: try:
Common.api.updRoomInfo() Common.api.updRoomInfo()
except Exception as e: except Exception as e:
@ -200,3 +189,14 @@ def run():
if Common.forceStartUploadThread: if Common.forceStartUploadThread:
awakeUpload() awakeUpload()
Common.forceStartUploadThread = False Common.forceStartUploadThread = False
if not isEncode and not isDownload:
# 防抖,避免主播因特殊情况下播导致直接投递了
if _firstDown < 30:
_firstDown += 1
sleep(60)
continue
Common.uploadQueue.put(True)
_firstDown = 0
isEncode = True
isDownload = True
time.sleep(60)