chore(api): 修改推送消息内容 TUN-133
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
Ching L 2024-11-14 16:28:18 +08:00
parent 50cd69f378
commit e8293c0a74

4
app.py
View File

@ -467,7 +467,7 @@ def consume_stream():
bark_push('%s 添加成功' % good_name, '条形码 %s' % msg['data']) bark_push('%s 添加成功' % good_name, '条形码 %s' % msg['data'])
else: else:
logger.error(f"Failed to process message: {msg['data']} {resp}") logger.error(f"Failed to process message: {msg['data']} {resp}")
bark_push('商品添加失败', '条形码 %s' % msg['data']) bark_push('商品添加失败', '条形码 %s \n %s' % (msg['data'], resp.get('message')))
else: else:
resp, status_code, good_name = consume_product_by_barcode(msg['data']) resp, status_code, good_name = consume_product_by_barcode(msg['data'])
if status_code == 200: if status_code == 200:
@ -475,7 +475,7 @@ def consume_stream():
bark_push('%s 消耗成功' % good_name, '条形码 %s' % msg['data']) bark_push('%s 消耗成功' % good_name, '条形码 %s' % msg['data'])
else: else:
logger.error(f"Failed to process message: {msg['data']} {resp}") logger.error(f"Failed to process message: {msg['data']} {resp}")
bark_push('商品消耗失败', '条形码 %s' % msg['data']) bark_push('商品消耗失败', '条形码 %s \n' % (msg['data'], resp.get('message')))
if consume_product_flag_key: if consume_product_flag_key:
r.delete(consume_product_flag_key) r.delete(consume_product_flag_key)