MCPcopy Index your code
hub / github.com/callstack/agent-device / stopSessionAudioProbe

Function stopSessionAudioProbe

src/daemon/audio-probe.ts:71–82  ·  view source on GitHub ↗
(
  session: SessionState,
  reason = 'session-cleanup',
)

Source from the content-addressed store, hash-verified

69}
70
71export async function stopSessionAudioProbe(
72 session: SessionState,
73 reason = 'session-cleanup',
74): Promise<AudioProbeResult | undefined> {
75 const probe = session.audioProbe;
76 if (!probe) return undefined;
77 const beforeStop = await readHostSystemAudioProbeStatus(session);
78 probe.child.kill('SIGTERM');
79 await probe.wait.catch(() => {});
80 session.audioProbe = undefined;
81 return finalizeHostSystemAudioProbeStatus(beforeStop, probe, reason);
82}
83
84async function waitForHostSystemAudioProbeStatus(session: SessionState): Promise<AudioProbeResult> {
85 const deadline = Date.now() + 5_000;

Callers 3

teardownSessionResourcesFunction · 0.90
handleCloseCommandFunction · 0.90

Calls 3

killMethod · 0.45

Tested by

no test coverage detected