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')
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
import { registerSW } from 'virtual:pwa-register'
|
||||
|
||||
export function registerMediaHivePwa(): void {
|
||||
const updateServiceWorker = registerSW({
|
||||
immediate: true,
|
||||
onNeedRefresh: () => void updateServiceWorker(true),
|
||||
})
|
||||
}
|
||||
Vendored
-1
@@ -1,5 +1,4 @@
|
||||
/// <reference types="vite/client" />
|
||||
/// <reference types="vite-plugin-pwa/client" />
|
||||
|
||||
declare module '*.vue' {
|
||||
import type { DefineComponent } from 'vue'
|
||||
|
||||
Reference in New Issue
Block a user