Commit 52c8352
feat: Improve browser task isolation and resource management
- Create isolated browser contexts for each task to prevent conflicts
- Replace global browser context with task-specific instances
- Add proper resource cleanup in finally blocks to prevent memory leaks
- Extract hardcoded values as constants for better maintainability
- Add comprehensive type hints throughout the codebase
- Improve error handling and logging
- Reorganize imports and improve code structure
- Update Dockerfile to use Playwright's bundled browser instead of custom Chrome
- Ensure each task runs in its own isolated environment with unique debugging ports
- Fix potential race conditions when multiple tasks access the same context1 parent 0e84f83 commit 52c8352
3 files changed
+287
-271
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
39 | | - | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| |||
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
59 | | - | |
60 | | - | |
| 58 | + | |
61 | 59 | | |
62 | 60 | | |
63 | 61 | | |
| |||
69 | 67 | | |
70 | 68 | | |
71 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
0 commit comments