From 90f503518fe9a6931f6205880f31bfbcd8662c94 Mon Sep 17 00:00:00 2001 From: yuyx <237899745@qq.com> Date: Fri, 12 Dec 2025 15:36:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug=E5=92=8C=E6=B8=85?= =?UTF-8?q?=E7=90=86=E8=B0=83=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. email_service.py: 删除未定义的log_email_send调用(send_email内部已记录日志) 2. app.py: 删除[DEBUG run_task]调试打印语句 3. playwright_automation.py: 删除[调试]诊断日志块 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- app.py | 3 +-- email_service.py | 14 -------------- playwright_automation.py | 14 -------------- 3 files changed, 1 insertion(+), 30 deletions(-) diff --git a/app.py b/app.py index 2b15ee1..9a976f0 100755 --- a/app.py +++ b/app.py @@ -1952,8 +1952,7 @@ def run_task(user_id, account_id, browse_type, enable_screenshot=True, source="m retry_count: 当前重试次数,用于自动重试机制(最多重试2次) """ MAX_AUTO_RETRY = 2 # 最大自动重试次数 - print(f"[DEBUG run_task] account={account_id}, enable_screenshot={enable_screenshot} (类型:{type(enable_screenshot).__name__}), source={source}, retry={retry_count}") - + if user_id not in user_accounts or account_id not in user_accounts[user_id]: return diff --git a/email_service.py b/email_service.py index 5d18c41..1272da4 100644 --- a/email_service.py +++ b/email_service.py @@ -2112,22 +2112,8 @@ def send_batch_task_complete_email( ) if result['success']: - # 记录发送日志 - log_email_send( - email_type='batch_task_complete', - to_email=email, - subject=f'定时任务完成 - {schedule_name}', - success=True - ) return {'success': True} else: - log_email_send( - email_type='batch_task_complete', - to_email=email, - subject=f'定时任务完成 - {schedule_name}', - success=False, - error=result.get('error', '') - ) return {'success': False, 'error': result.get('error', '发送失败')} diff --git a/playwright_automation.py b/playwright_automation.py index 38cd347..9b4c850 100755 --- a/playwright_automation.py +++ b/playwright_automation.py @@ -802,20 +802,6 @@ class PlaywrightAutomation: if rows_count == 0: self.log("当前页面没有内容") - # 调试:输出页面信息帮助诊断 - try: - page_html = self.page.content() - if 'ltable' in page_html: - self.log(f"[调试] 表格存在,但没有数据行") - # 检查是否有"暂无记录"提示 - if '暂无' in page_html or '没有' in page_html: - self.log(f"[调试] 页面显示暂无记录") - else: - self.log(f"[调试] 页面中没有找到ltable表格") - # 检查URL - self.log(f"[调试] iframe URL: {self.page.url}") - except Exception as debug_e: - self.log(f"[调试] 获取页面信息失败: {str(debug_e)[:50]}") empty_page_counter += 1 self.log(f"连续空页面数: {empty_page_counter}")