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:
2026-05-24 19:01:13 +00:00
parent b574c974a7
commit 8586bd26e1
8 changed files with 84 additions and 131 deletions
+7 -4
View File
@@ -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')