From cb5d9a8287d15a830d3e2337bea838b07fb2d3b5 Mon Sep 17 00:00:00 2001 From: Selfhost Alt Date: Sat, 23 Apr 2022 10:26:37 -0700 Subject: [PATCH] Add explicit byte conversion variable to make code more self-documenting --- server/managers/BackupManager.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/managers/BackupManager.js b/server/managers/BackupManager.js index 472fdd9b..f66d40cf 100644 --- a/server/managers/BackupManager.js +++ b/server/managers/BackupManager.js @@ -260,7 +260,8 @@ class BackupManager { reject(err) }) archive.on('progress', ({ fs: fsobj }) => { - if (fsobj.processedBytes > this.serverSettings.maxBackupSize * 1000 * 1000 * 1000) { + const maxBackupSizeInBytes = this.serverSettings.maxBackupSize * 1000 * 1000 * 1000 + if (fsobj.processedBytes > maxBackupSizeInBytes) { Logger.error(`[BackupManager] Archiver is too large - aborting to prevent endless loop, Bytes Processed: ${fsobj.processedBytes}`) archive.abort() setTimeout(() => {