feat(reservation): Update reservation details and improve logging

- Updated reservation JSON data with new room titles, prize values, and timestamps.
- Enhanced logging in `douyin_fudai_core.py` to include OCR duration summaries for better analysis.
- Modified `SwipeHandler` to allow forced switching during seek processes to prevent deadlocks.
- Improved logging wrapper to handle field extraction and elapsed time calculations more robustly.
- Refactored log formatting functions for better readability and consistency.
- Added total timeout handling in `process_reservation_attend_window` to prevent blocking.
- Removed automatic backtracking in reservation verification to avoid infinite loops.
- Updated configuration management to include total timeout settings for reservations.
- Enhanced error handling and logging in `fudai_detail_reader.py` for validation failures.
This commit is contained in:
Your Name committed 2026-01-03 13:30:55 +08:00
1 parent 1223a1ea5a
commit 2fa2073f2e
11 files changed
+282 -784

No files matched your search

+20 -2
View File
@@ -568,6 +568,13 @@ class underlying_operations:
def _get_screenshot_direct(self, device_id, path="pic"):
"""直接截图(不使用服务模式)"""
overall_start = time_module.time()
# 初始化分阶段耗时占位,确保最终汇总时总有值
cleanup_dur = 0.0
adb_subprocess_dur = 0.0
validate_tmp_dur = 0.0
replace_dur = 0.0
mirror_dur = 0.0
validate_out_dur = 0.0
if path == "pic":
try:
@@ -765,8 +772,7 @@ class underlying_operations:
header = f.read(4)
if header == b"\x89PNG":
validate_out_dur = (
time_module.time()
- validate_out_start
time_module.time() - validate_out_start
) * 1000.0
if validate_out_dur > 50.0:
logging.info(
@@ -777,6 +783,18 @@ class underlying_operations:
overall_dur = (
time_module.time() - overall_start
) * 1000.0
# 记录分阶段耗时汇总,便于排查瓶颈(JSON-like)
logging.info(
"[截图汇总] device=%s total_ms=%.1f cleanup_ms=%.1f adb_execout_ms=%.1f validate_tmp_ms=%.1f replace_ms=%.1f mirror_ms=%.1f validate_out_ms=%.1f",
device_id,
overall_dur,
cleanup_dur,
adb_subprocess_dur,
validate_tmp_dur,
replace_dur,
mirror_dur,
validate_out_dur,
)
logging.info(
"[截图] _get_screenshot_direct总耗时(ms)=%.1f device=%s (exec-out成功)",
overall_dur,