fix(web): stop config watcher on native shutdown #109
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@when/web': patch
|
||||
---
|
||||
|
||||
Stop the configuration watcher after native server shutdown so the web process can exit cleanly.
|
||||
@@ -20,11 +20,12 @@ export async function bootApp(): Promise<void> {
|
||||
makeAuth(config);
|
||||
setState({ config, db });
|
||||
|
||||
watchConfig((result) =>
|
||||
const stopWatching = watchConfig((result) =>
|
||||
applyConfig(result, {
|
||||
current: () => getState().config,
|
||||
swap: (next) => setState({ config: next, db }),
|
||||
restart: () => process.exit(0)
|
||||
})
|
||||
);
|
||||
process.once('sveltekit:shutdown', stopWatching);
|
||||
}
|
||||
Reference in new issue
Block a user