mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
retry
This commit is contained in:
parent
868250cd7b
commit
8a8174942b
@ -68,7 +68,11 @@ class common:
|
|||||||
|
|
||||||
while True:
|
while True:
|
||||||
pair = self.__tasks_searchfordata.get()
|
pair = self.__tasks_searchfordata.get()
|
||||||
|
if len(pair) == 2:
|
||||||
gameuid, vid = pair
|
gameuid, vid = pair
|
||||||
|
retrytime = 5
|
||||||
|
elif len(pair) == 3:
|
||||||
|
gameuid, vid, retrytime = pair
|
||||||
remove = True
|
remove = True
|
||||||
try:
|
try:
|
||||||
self.__do_searchfordata(gameuid, vid)
|
self.__do_searchfordata(gameuid, vid)
|
||||||
@ -83,7 +87,11 @@ class common:
|
|||||||
|
|
||||||
self.__safe_remove_task("searchfordatatasks", pair)
|
self.__safe_remove_task("searchfordatatasks", pair)
|
||||||
else:
|
else:
|
||||||
self.__tasks_searchfordata.put((gameuid, vid))
|
if retrytime:
|
||||||
|
# 尝试5次仍不行则放弃
|
||||||
|
self.__tasks_searchfordata.put((gameuid, vid, retrytime - 1))
|
||||||
|
else:
|
||||||
|
self.__safe_remove_task("searchfordatatasks", pair)
|
||||||
gobject.baseobject.translation_ui.displayglobaltooltip.emit(vis)
|
gobject.baseobject.translation_ui.displayglobaltooltip.emit(vis)
|
||||||
|
|
||||||
def __tasks_downloadimg_thread(self):
|
def __tasks_downloadimg_thread(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user