atomic_write_in_dir Update statsd.py

This commit is contained in:
lucky lin 2024-06-03 14:32:44 +08:00 committed by GitHub
parent fcc9c08886
commit 6bff4806bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -163,7 +163,7 @@ def main() -> NoReturn:
if len(os.listdir(STATS_DIR)) < STATS_DIR_FILE_LIMIT:
if len(result) > 0:
stats_path = os.path.join(STATS_DIR, f"{current_time.timestamp():.0f}_{idx}")
with atomic_write_in_dir(stats_path) as f:
with atomic_write_in_dir(stats_path, mode="w", overwrite=True) as f:
f.write(result)
idx += 1
else: