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. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_browser_pool.py | ||
| test_ebay_auth.py | ||
| test_ebay_normaliser.py | ||
| test_ebay_scraper.py | ||