Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Commit

Permalink
主程序 -- 修复Bug和改进
Browse files Browse the repository at this point in the history
  • Loading branch information
Ljzd-PRO authored Oct 13, 2021
1 parent 1579a99 commit 7b63a49
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def get_file_path(file_name=""):
timesleep_1 = 2
if timesleep_2 == '' or None:
timesleep_2 = 4
timesleep_1 = int(timesleep_1)
timesleep_2 = int(timesleep_2)
timesleep_1 = float(timesleep_1)
timesleep_2 = float(timesleep_2)

result_error = {}
result_exception = {}
Expand All @@ -54,6 +54,7 @@ def check(i):
else:
return True

## 开始操作
i = 1
while True:
userdata["uid"] = conf.get("Cookies", "uid_{0}".format(i))
Expand Down Expand Up @@ -98,6 +99,7 @@ def check(i):
print(start.to_log("INFO", "正在重启执行失败和异常用户的任务。"))
if result_error != {}:
it = iter(result_error)
del_error_id = []
while True:
try:
error_id = next(it)
Expand All @@ -106,20 +108,27 @@ def check(i):
userdata["id"] = error_id
result = start.start(userdata, setting)
if result == "success":
del result_error[error_id]
del_error_id.append(error_id)
except StopIteration:
if del_error_id != []:
for id in del_error_id:
del result_error[id]
break
if result_exception != {}:
it = iter(result_exception)
del_exception_id = []
while True:
try:
exception_id = next(it)
userdata["uid"] = conf.get("Cookies", "uid_{0}".format(exception_id))
userdata["stoken"] = conf.get("Cookies", "stoken_{0}".format(exception_id))
result = start.start(userdata, setting)
if result == "success":
del result_exception[exception_id]
del_exception_id.append(exception_id)
except StopIteration:
if del_exception_id != []:
for id in del_exception_id:
del result_exception[id]
break

## 再次检查执行失败的用户
Expand Down

0 comments on commit 7b63a49

Please sign in to comment.