Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

Commit 8766bfe

Browse files
committed
Schedule timer for when HandlerContext isn't available
1 parent 3c8d754 commit 8766bfe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/api-helper/project/CachingProjectLoader.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ async function saveAndRunAction<T>(delegate: ProjectLoader,
9191
const p = await save(delegate, params);
9292
if (params.context && params.context.lifecycle) {
9393
params.context.lifecycle.registerDisposable(async () => cleanUp(p));
94+
} else {
95+
// schedule a cleanup timer but don't block the Node.js event loop for this
96+
setTimeout(() => cleanUp(p), 10000).unref();
9497
}
9598
return action(p);
9699
}

0 commit comments

Comments
 (0)