From 8c949ed440bd2e45ea1867329d546197913e1a1a Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Thu, 17 Aug 2023 15:32:13 +0300 Subject: [PATCH] Atomic file write in stats --- statsHelpers.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/statsHelpers.js b/statsHelpers.js index 9d7816bd2..f9e56e426 100644 --- a/statsHelpers.js +++ b/statsHelpers.js @@ -9,7 +9,8 @@ const fs = require("fs"); const path = require("path"); const util = require("util"); -const writeFile = util.promisify(fs.writeFile); +const writeFileAtomic = require("write-file-atomic"); +const writeFile = util.promisify(writeFileAtomic); const readFile = util.promisify(fs.readFile); const readdir = util.promisify(fs.readdir); const crypto = require("crypto");