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:
DrSmoothl committed 2026-08-22 19:44:25 +08:00
1 parent 5441203b76
commit a395577f77
5 files changed
+64 -4

No files matched your search

+7 -1
View File
@@ -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;
}