remove retry code in rsschecker

This commit is contained in:
2021-05-05 11:11:00 +08:00
parent 2726fcbbd1
commit fabbc81845

View File

@@ -46,20 +46,14 @@ class RSSCheckerThread(Thread):
for info in rss.chatList: for info in rss.chatList:
chatEntry: ChatEntry = info chatEntry: ChatEntry = info
try: try:
for i in range(self._main._setting._maxRetryCount + 1): suc, text = self._main._sendMessage(
suc, text = self._main._sendMessage( chatEntry.chatId, meta, item, chatEntry.config, True)
chatEntry.chatId, meta, item, chatEntry.config, True) if not suc:
if suc: text2 = f'\n{rss.title}'
break if 'link' in item:
sleep(5) text2 = f"{text2}\n{item['link']}"
if i < self._main._setting._maxRetryCount: self._main._request('sendMessage', 'post', {
print(f'开始第{i+i}次重试\n{text}') 'chat_id': chatEntry.chatId, 'text': f'发送失败。\n{text}{text2}'})
else:
text2 = f'\n{rss.title}'
if 'link' in item:
text2 = f"{text2}\n{item['link']}"
self._main._request('sendMessage', 'post', {
'chat_id': chatEntry.chatId, 'text': f'已尝试重发{i}次,发送失败。\n{text}{text2}'})
except: except:
print(format_exc()) print(format_exc())
else: else: