fix(protocol): stop flooding logs when disk writes fail
After identity persistence is suspended, later observations were still logged one-by-one. That filled Docker logs and made the WebUI log stream unusable while the bot kept receiving messages. Report the skip once, then at most once a minute with a count. Console write failures must not throw into message handling.
This commit is contained in:
5 files changed
+64
-4
No files matched your search
@@ -506,7 +506,13 @@ class FileWriter {
|
||||
}
|
||||
|
||||
if (!this.quota.reserve(this.file.path, bytes)) return false;
|
||||
this.file.stream.write(data);
|
||||
try {
|
||||
this.file.stream.write(data);
|
||||
} catch (error) {
|
||||
this.disabled = true;
|
||||
this.quota.writeFailed(this.file.path, error);
|
||||
return false;
|
||||
}
|
||||
this.file.bytes += bytes;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user