stop crash error
This commit is contained in:
parent
208a478440
commit
b0637705f0
@ -247,6 +247,12 @@ function startPacat(browserSessId) {
|
||||
console.log(`[pacat:${browserSessId}] exited with code ${code}`);
|
||||
pacatProcesses.delete(browserSessId);
|
||||
});
|
||||
// Prevent EPIPE from crashing the server when pacat exits while we're
|
||||
// still writing to its stdin (e.g. mic frames arriving after disconnect).
|
||||
pacat.stdin.on('error', err => {
|
||||
if (err.code !== 'EPIPE') console.error(`[pacat:${browserSessId}] stdin error: ${err.message}`);
|
||||
pacatProcesses.delete(browserSessId);
|
||||
});
|
||||
pacatProcesses.set(browserSessId, pacat);
|
||||
return pacat;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user