fix: auto-fix code issues (cron)

- 修复重复导入/字段
- 修复异常处理
- 修复PEP8格式问题
- 添加类型注解
This commit is contained in:
AutoFix Bot
2026-03-03 06:03:38 +08:00
parent 2a0ed6af4d
commit 9fd1da8fb7
41 changed files with 901 additions and 768 deletions

View File

@@ -159,7 +159,7 @@ def test_cache_manager() -> None:
# 批量操作
cache.set_many(
{"batch_key_1": "value1", "batch_key_2": "value2", "batch_key_3": "value3"}, ttl=60
{"batch_key_1": "value1", "batch_key_2": "value2", "batch_key_3": "value3"}, ttl=60,
)
print(" ✓ 批量设置缓存")
@@ -208,7 +208,7 @@ def test_task_queue() -> None:
# 提交任务
task_id = queue.submit(
task_type="test_task", payload={"test": "data", "timestamp": time.time()}
task_type="test_task", payload={"test": "data", "timestamp": time.time()},
)
print(" ✓ 提交任务: {task_id}")
@@ -267,7 +267,7 @@ def test_performance_monitor() -> None:
for type_stat in stats.get("by_type", []):
print(
f" {type_stat['type']}: {type_stat['count']} 次, "
f"平均 {type_stat['avg_duration_ms']} ms"
f"平均 {type_stat['avg_duration_ms']} ms",
)
print("\n✓ 性能监控测试完成")