refactor: 简化守护模式日志格式

This commit is contained in:
2026-02-05 21:57:42 +08:00
parent 79168dec7e
commit 1013c47524

View File

@@ -503,7 +503,7 @@ def run_daemon(batch_size=None, concurrency=None, interval=10):
while running:
round_count += 1
logger.info(f"\n[第 {round_count}] 检查待处理数据...")
logger.info(f"[{round_count}] 检查待处理数据...")
try:
results = batch_derive_tags(
@@ -516,12 +516,12 @@ def run_daemon(batch_size=None, concurrency=None, interval=10):
failed = len(results) - success
total_success += success
total_failed += failed
logger.info(f"[{round_count}] 处理完成: 成功 {success}, 失败 {failed}")
logger.info(f"[{round_count}] 处理完成: 成功 {success}, 失败 {failed}")
else:
logger.info(f"[{round_count}] 没有待处理的数据")
logger.info(f"[{round_count}] 没有待处理的数据")
except Exception as e:
logger.error(f"[{round_count}] 处理异常: {e}")
logger.error(f"[{round_count}] 处理异常: {e}")
if running:
logger.info(f"等待 {interval} 秒后继续...")
@@ -533,7 +533,7 @@ def run_daemon(batch_size=None, concurrency=None, interval=10):
logger.info("=" * 60)
logger.info("服务已停止")
logger.info(f"统计: 共运行 {round_count} , 成功 {total_success} 条, 失败 {total_failed}")
logger.info(f"统计: 共运行 {round_count} , 成功 {total_success} 条, 失败 {total_failed}")
logger.info("=" * 60)