Playwright's sync API binds its greenlet event loop to the creating thread. Sharing pre-warmed slots across threads caused "cannot switch to a different thread" panics under uvicorn. New design: each worker thread owns its own Playwright instance created lazily on first fetch_html() call. A registry dict keyed by thread-id lets stop() close all slots at shutdown. Removes ThreadPoolExecutor warmup and idle-cleanup daemon thread entirely. |
||
|---|---|---|
| .. | ||
| db | ||
| llm | ||
| mcp | ||
| platforms | ||
| tasks | ||
| trust | ||
| ui | ||
| wizard | ||
| __init__.py | ||
| tiers.py | ||