refactor(instance-store): consolidate dispose helpers (#25424)
This commit is contained in:
@@ -9,7 +9,7 @@ export async function bootstrap<T>(directory: string, cb: () => Promise<T>) {
|
||||
const result = await cb()
|
||||
return result
|
||||
} finally {
|
||||
await InstanceStore.runtime.runPromise((s) => s.dispose(Instance.current))
|
||||
await InstanceStore.disposeInstance(Instance.current)
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -88,7 +88,7 @@ export const rpc = {
|
||||
async shutdown() {
|
||||
Log.Default.info("worker shutting down")
|
||||
|
||||
await InstanceStore.runtime.runPromise((s) => s.disposeAll())
|
||||
await InstanceStore.disposeAllInstances()
|
||||
if (server) await server.stop(true)
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user