MCPcopy Create free account
hub / github.com/Mashiro2000/HeyTapTask / main_handler

Function main_handler

Backup/otherTask.py:222–241  ·  view source on GitHub ↗
(event, context)

Source from the content-addressed store, hash-verified

220
221# 兼容云函数
222def main_handler(event, context):
223 global lists
224 for each in lists:
225 if all(each.values()):
226 if checkHT(each):
227 otherTask = OtherTask(each)
228 for count in range(3):
229 try:
230 time.sleep(random.randint(2,5)) # 随机延时
231 otherTask.start()
232 break
233 except requests.exceptions.ConnectionError:
234 notify(f"{otherTask.dic['user']}\t请求失败,随机延迟后再次访问")
235 time.sleep(random.randint(2,5))
236 continue
237 else:
238 notify(f"账号: {otherTask.dic['user']}\n状态: 取消登录\n原因: 多次登录失败")
239 break
240 if not os.path.basename(__file__).split('_')[-1][:-3] in notifyBlackList:
241 send('欢太其它活动',allMess)
242
243if __name__ == '__main__':
244 main_handler(None,None)

Callers 1

otherTask.pyFile · 0.70

Calls 5

startMethod · 0.95
sendFunction · 0.90
OtherTaskClass · 0.85
checkHTFunction · 0.70
notifyFunction · 0.70

Tested by

no test coverage detected