exception handle
This commit is contained in:
19
robot.py
19
robot.py
@@ -333,11 +333,18 @@ class Robot(Job):
|
|||||||
|
|
||||||
|
|
||||||
def messageCountToDB(self):
|
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):
|
def generateAndSendRanking(self):
|
||||||
receivers = self.config.NEWS
|
try:
|
||||||
if not receivers:
|
receivers = self.config.NEWS
|
||||||
return
|
if not receivers:
|
||||||
for r in receivers:
|
return
|
||||||
self.sendTextMsg(generate_and_send_ranking(r,self.allContacts), r)
|
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}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user