支持重新发送

This commit is contained in:
2021-01-08 13:32:20 +08:00
parent 9ab4fb72e4
commit 04633d6758
2 changed files with 10 additions and 2 deletions

View File

@@ -39,8 +39,15 @@ class RSSCheckerThread(Thread):
for info in rss.chatList:
chatEntry: ChatEntry = info
try:
self._main._sendMessage(
chatEntry.chatId, meta, item, chatEntry.config)
for i in range(self._main._setting._maxRetryCount + 1):
if self._main._sendMessage(chatEntry.chatId, meta, item, chatEntry.config):
break
sleep(5)
if i < self._main._setting._maxRetryCount:
print(f'开始第{i+i}次重试')
else:
self._main._request('sendMessage', 'post', {
'chat_id': chatEntry.chatId, 'text': f'已尝试重发{i}次,发送失败。'})
except:
print(format_exc())
self._main._db.updateRSS(