重订单问题加日志跟踪
This commit is contained in:
parent
f198c68b4e
commit
80ec356516
2
app.py
2
app.py
@ -51,6 +51,8 @@ class XProcess(Process):
|
||||
|
||||
elif 'track' in type_:
|
||||
# continue
|
||||
if data['#event_name'] == 'pay':
|
||||
self.log.info(data)
|
||||
obj = getattr(handler_event, type_)
|
||||
obj(data)
|
||||
elif type_ == settings.STOP_SIGNAL:
|
||||
|
@ -80,9 +80,11 @@ class Transmitter:
|
||||
self.db_client.execute(sql)
|
||||
self.log.info(f'进程{self.p} 写入耗时 {int(time.time() * 1000) - ts}')
|
||||
except Exception as e:
|
||||
self.log.error(traceback.format_exc())
|
||||
# 丢弃错误行 再次发送
|
||||
if hasattr(e, 'code') and e.code == 26:
|
||||
m = re.match('(.*)?Stack trace', e.message)
|
||||
self.log.error(data)
|
||||
if m:
|
||||
error_msg = m.group(1)
|
||||
error_row = re.match('.*?errors out of (\d+) rows', error_msg)
|
||||
|
Loading…
Reference in New Issue
Block a user