MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / flushStdout

Function flushStdout

apps/cli/src/commands/cli/run.ts:372–391  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

370 }
371
372 const flushStdout = async () => {
373 try {
374 if (!process.stdout.writable || process.stdout.destroyed) {
375 return
376 }
377
378 await new Promise<void>((resolve, reject) => {
379 process.stdout.write("", (error?: Error | null) => {
380 if (error) {
381 reject(error)
382 return
383 }
384
385 resolve()
386 })
387 })
388 } catch {
389 // Best effort: shutdown should proceed even if stdout flush fails.
390 }
391 }
392
393 const ensureKeepAliveInterval = () => {
394 if (!signalOnlyExit || keepAliveInterval) {

Callers 2

shutdownFunction · 0.85
runFunction · 0.85

Calls 1

writeMethod · 0.65

Tested by

no test coverage detected