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

Function createShutdownHookRegistry

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected