FIX: liên tục mở tab browser trên exe

This commit is contained in:
2026-08-08 10:25:54 +07:00
parent 19d9bf3c9e
commit 3fc2087ee1
4 changed files with 27 additions and 12 deletions
+16
View File
@@ -3014,3 +3014,19 @@
- **FIX (engine.spec):** thêm hiddenimports celery family: celery.fixups(+django), celery.backends(+redis), celery.schedules, celery.app.builtins, kombu.transport.redis, billiard, vine, redis.
- **Các file ảnh hưởng:** engine.spec, wiki.md.
- **Ghi chú/Test:** build lại `pyinstaller engine.spec --clean --noconfirm` → chạy daw_engine.exe → server khởi động (localhost:8000).
### [2026-08-08 09:25] Task: FIX tauri build — Access denied khi copy sidecar (daw_engine đang chạy)
- **Lỗi:** tauri-build panic `Os { code: 5, kind: PermissionDenied }` — không copy được externalBin — vì `daw_engine.exe` ĐANG CHẠY (test lần trước — tiến trình giữ file).
- **FIX (build_windows.bat [6/6]):** thêm `taskkill /F /IM daw_engine.exe >nul 2>nul` trước `npx tauri build`.
- **Các file ảnh hưởng:** build_windows.bat, wiki.md.
- **Ghi chú/Test:** (1) tay: Task Manager → kết thúc mọi `daw_engine.exe``npx tauri build` lại; (2) script mới tự kill.
### [2026-08-08 09:30] Task: FIX daw_engine mở tab browser liên tục + không kill được process
- **Lỗi:** (1) exe mở tab browser liên tục; (2) taskkill không giết được process.
- **Nguyên nhân:** (1) main.py `threading.Timer(2.0, webbrowser.open)` — mở browser mỗi lần exe chạy (Tauri shell ĐÃ mở window localhost — thừa); (2) PyInstaller ONEFILE = parent + child — Tauri `child.kill()` chỉ giết PARENT → CHILD ORPHAN chạy mãi (server sống → vẫn mở tab qua timer cũ).
- **FIX:**
(1) `main.py` — XÓA auto-open browser (Tauri window url=localhost:8000 đảm nhiệm; standalone mở tay).
(2) `src-tauri/src/lib.rs` — khi window destroyed: child.kill() + `taskkill /F /T /IM daw_engine.exe` (kill CẢ TREE — cả parent + child onefile).
(3) `build_windows.bat``taskkill /F /T /IM` (tree).
- **Các file ảnh hưởng:** main.py, src-tauri/src/lib.rs, build_windows.bat, wiki.md.
- **Ghi chú/Test:** build lại exe + tauri → đóng app → Task Manager không còn daw_engine (cả tree) + không mở tab mới. Kill tay lúc này: `taskkill /F /T /IM daw_engine.exe`.