修复通知服务的异常机制

This commit is contained in:
ngfchl
2023-02-13 13:32:07 +08:00
parent ab5d943a63
commit 9c28b7ee6d

View File

@@ -130,8 +130,8 @@ class PtSpider:
res = '你还没有配置通知参数哦!' res = '你还没有配置通知参数哦!'
if len(notifies) <= 0: if len(notifies) <= 0:
return res return res
try: for notify in notifies:
for notify in notifies: try:
if notify.name == PushConfig.wechat_work_push: if notify.name == PushConfig.wechat_work_push:
"""企业微信通知""" """企业微信通知"""
notify_push = WechatPush( notify_push = WechatPush(
@@ -185,9 +185,8 @@ class PtSpider:
'desp': message 'desp': message
}) })
logger.info('爱语飞飞通知:{}'.format(res)) logger.info('爱语飞飞通知:{}'.format(res))
except Exception as e: except Exception as e:
logger.info('通知发送失败,{} {}'.format(res, traceback.format_exc(limit=5))) logger.info('通知发送失败,{} {}'.format(res, traceback.format_exc(limit=5)))
raise
def send_request(self, def send_request(self,
my_site: MySite, my_site: MySite,