fix: 修复browser_installer.py语法错误,同步服务器代码

- 修复browser_installer.py顶部错误的import语句
- 移除browser_installer.py中未正确实现的_cleanup_zombie_processes方法
- 恢复playwright_automation.py中的SIGKILL(服务器版本)
- 同步database.py和email_service.py的最新代码

注意:内存占用从50MB增加到142MB是正常的,因为:
1. 4个浏览器Worker线程(按需模式)占用基础内存
2. 新增的清理代码和SIGCHLD处理器占用少量内存
3. 当前内存使用在正常范围内

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-13 03:35:12 +08:00
parent b905739515
commit 42cc86e290
4 changed files with 115 additions and 142 deletions

View File

@@ -802,6 +802,20 @@ 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}")
@@ -1438,7 +1452,7 @@ class PlaywrightAutomation:
try:
import os
import signal
os.kill(browser_pid, signal.SIGTERM); import time; time.sleep(0.5); os.waitpid(browser_pid, os.WNOHANG)
os.kill(browser_pid, signal.SIGKILL)
except (ProcessLookupError, PermissionError, OSError):
pass # 进程可能已经退出