Remove PWA/SW and fix blocking startup I/O
- Remove vite-plugin-pwa and all service worker code. The app no longer registers a service worker; legacy SWs are unregistered on load. - Move snapshot parsing (thousands of sync Path.exists() calls) into a thread pool via asyncio.to_thread() so the health check responds immediately on startup. - Wrap aiopathlib AsyncPath.iterdir() (sync os.scandir under the hood) in asyncio.to_thread() in scanner and scanning modules so directory walks do not monopolize the event loop.
This commit is contained in:
@@ -11,10 +11,13 @@ installInputModalityTracking()
|
||||
installKeyboardNavigation()
|
||||
installGamepadNavigation()
|
||||
|
||||
if ('serviceWorker' in navigator && !navigator.serviceWorker.controller) {
|
||||
navigator.serviceWorker.addEventListener('controllerchange', () => {
|
||||
window.location.reload()
|
||||
}, { once: true })
|
||||
// Unregister any legacy service workers — MediaHive no longer uses a PWA/SW.
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.getRegistrations().then((registrations) => {
|
||||
for (const registration of registrations) {
|
||||
registration.unregister()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
createApp(App).use(router).mount('#app')
|
||||
|
||||
Reference in New Issue
Block a user