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 | ||
| platforms | ||
| test_tasks | ||
| trust | ||
| ui | ||
| __init__.py | ||
| test_api_search_build.py | ||
| test_async_search.py | ||
| test_ebay_categories.py | ||
| test_feedback.py | ||
| test_preferences_currency.py | ||
| test_query_translator.py | ||
| test_search_cache.py | ||
| test_tiers.py | ||