exception handle

This commit is contained in:
2025-02-07 10:22:43 +08:00
parent e4351b2d4a
commit 64ee2ba2f5

View File

@@ -333,11 +333,18 @@ class Robot(Job):
def messageCountToDB(self):
write_to_db()
try:
write_to_db()
except Exception as e:
self.LOG.error(f"write_to_db error{e}")
def generateAndSendRanking(self):
receivers = self.config.NEWS
if not receivers:
return
for r in receivers:
self.sendTextMsg(generate_and_send_ranking(r,self.allContacts), r)
try:
receivers = self.config.NEWS
if not receivers:
return
for r in receivers:
self.sendTextMsg(generate_and_send_ranking(r, self.allContacts), r)
except Exception as e:
self.LOG.error(f"SendRanking error{e}")