Avoid loop in Boardcaster is not found and stop download

This commit is contained in:
Jerry Yan 2019-05-11 21:21:43 +08:00 committed by JerryYan
parent f4bc6d847d
commit b61bd4c70c
2 changed files with 11 additions and 1 deletions

View File

@ -314,4 +314,9 @@ class downloader(XiGuaLiveApi):
pass pass
api = downloader(config["l_u"]) api = downloader(config["l_u"])
def refreshDownloader():
global api
api = downloader(config["l_u"])

View File

@ -177,6 +177,9 @@ def run():
_count_error = 0 _count_error = 0
except Exception as e: except Exception as e:
Common.appendError(e.__str__()) Common.appendError(e.__str__())
_count_error += 1
if not Common.api.roomLiver:
_count_error += 1
if Common.forceStartEncodeThread: if Common.forceStartEncodeThread:
if not et.is_alive(): if not et.is_alive():
et = threading.Thread(target=encode, args=()) et = threading.Thread(target=encode, args=())
@ -190,3 +193,5 @@ def run():
ut.setDaemon(True) ut.setDaemon(True)
ut.start() ut.start()
Common.forceStartUploadThread = False Common.forceStartUploadThread = False
if _count_error>10:
Common.refreshDownloader()