MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / createShutdownHookRegistry

Function createShutdownHookRegistry

scripts/dev-process-utils.mjs:126–145  ·  view source on GitHub ↗
(onError)

Source from the content-addressed store, hash-verified

124}
125
126export function createShutdownHookRegistry(onError) {
127 const hooks = new Set();
128
129 return {
130 add(hook) {
131 hooks.add(hook);
132 return () => hooks.delete(hook);
133 },
134
135 run() {
136 for (const hook of hooks) {
137 try {
138 hook();
139 } catch (err) {
140 onError?.(err);
141 }
142 }
143 },
144 };
145}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected