mirror of
https://github.com/whyour/qinglong.git
synced 2026-02-12 14:05:38 +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
|
||||
stream.on('error', (error) => {
|
||||
this.emit('error', { filePath, error });
|
||||
this.closeStream(filePath);
|
||||
// Remove the stream from the map on error
|
||||
this.streams.delete(filePath);
|
||||
reject(error);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user