mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-03 05:12:15 +00:00
fix(tasks): close registry stores on test resets
This commit is contained in:
@@ -710,6 +710,6 @@ export function resetTaskFlowRegistryForTests(opts?: { persist?: boolean }) {
|
||||
resetTaskFlowRegistryRuntimeForTests();
|
||||
if (opts?.persist !== false) {
|
||||
persistFlowRegistry();
|
||||
getTaskFlowRegistryStore().close?.();
|
||||
}
|
||||
getTaskFlowRegistryStore().close?.();
|
||||
}
|
||||
|
||||
@@ -1927,10 +1927,10 @@ export function resetTaskRegistryForTests(opts?: { persist?: boolean }) {
|
||||
listenerStarted = false;
|
||||
if (opts?.persist !== false) {
|
||||
persistTaskRegistry();
|
||||
// Close the sqlite handle after persisting the empty snapshot so Windows temp-dir
|
||||
// cleanup can remove the state directory without hitting runs.sqlite EBUSY errors.
|
||||
getTaskRegistryStore().close?.();
|
||||
}
|
||||
// Always close the sqlite handle so Windows temp-dir cleanup can remove the
|
||||
// state directory even when a test intentionally skips persisting the reset.
|
||||
getTaskRegistryStore().close?.();
|
||||
}
|
||||
|
||||
export function resetTaskRegistryDeliveryRuntimeForTests() {
|
||||
|
||||
Reference in New Issue
Block a user