mirror of
https://github.com/whyour/qinglong.git
synced 2026-02-12 22:16:42 +08:00
Fix error handler in LogStreamManager to avoid race conditions
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
parent
995b035d40
commit
07e8b4a9ba
|
|
@ -32,7 +32,8 @@ export class LogStreamManager extends EventEmitter {
|
||||||
// Handle stream errors
|
// Handle stream errors
|
||||||
stream.on('error', (error) => {
|
stream.on('error', (error) => {
|
||||||
this.emit('error', { filePath, error });
|
this.emit('error', { filePath, error });
|
||||||
this.closeStream(filePath);
|
// Remove the stream from the map on error
|
||||||
|
this.streams.delete(filePath);
|
||||||
reject(error);
|
reject(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user