auto-sync: 2026-05-17 06:32:52

This commit is contained in:
cfdaily
2026-05-17 06:32:52 +08:00
parent e1b050b054
commit ec951dbfa6
+2 -2
View File
@@ -168,8 +168,8 @@ class InboxWatcher:
def _truncate(self) -> None: def _truncate(self) -> None:
"""清空文件内容(不删除文件)""" """清空文件内容(不删除文件)"""
try: try:
with open(self.inbox_path, "w", encoding="utf-8") as f: with open(self.inbox_path, "w", encoding="utf-8"):
f.truncate(0) pass # "w" mode already truncates
except OSError: except OSError:
logger.exception("Failed to truncate inbox: %s", self.inbox_path) logger.exception("Failed to truncate inbox: %s", self.inbox_path)