MCPcopy Index your code
hub / github.com/codeaashu/claude-code / finalizePendingAsyncHooks

Function finalizePendingAsyncHooks

src/utils/hooks/AsyncHookRegistry.ts:281–301  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

279}
280
281export async function finalizePendingAsyncHooks(): Promise<void> {
282 const hooks = Array.from(pendingHooks.values())
283 await Promise.all(
284 hooks.map(async hook => {
285 if (hook.shellCommand?.status === 'completed') {
286 const result = await hook.shellCommand.result
287 await finalizeHook(
288 hook,
289 result.code,
290 result.code === 0 ? 'success' : 'error',
291 )
292 } else {
293 if (hook.shellCommand && hook.shellCommand.status !== 'killed') {
294 hook.shellCommand.kill()
295 }
296 await finalizeHook(hook, 1, 'cancelled')
297 }
298 }),
299 )
300 pendingHooks.clear()
301}
302
303// Test utility function to clear all hooks
304export function clearAllAsyncHooks(): void {

Callers 2

runFunction · 0.85
runHeadlessStreamingFunction · 0.85

Calls 4

finalizeHookFunction · 0.85
valuesMethod · 0.80
killMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected