From 295c74a7a9b9452f3073d7d2e92124e8d49ee2b2 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Sun, 26 Mar 2023 17:02:44 +0200 Subject: [PATCH] notifications: use clearAlert to clear disk space message --- src/system.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/system.js b/src/system.js index 2cd6b4275..e7f563fac 100644 --- a/src/system.js +++ b/src/system.js @@ -167,9 +167,12 @@ async function checkDiskSpace() { debug(`checkDiskSpace: disk space checked. out of space: ${markdownMessage || 'no'}`); - if (markdownMessage) markdownMessage = `One or more file systems are running out of space. Please increase the disk size at the earliest.\n\n${markdownMessage}`; - - await notifications.alert(notifications.ALERT_DISK_SPACE, 'Server is running out of disk space', markdownMessage, { persist: true }); + if (markdownMessage) { + const finalMessage = `One or more file systems are running out of space. Please increase the disk size at the earliest.\n\n${markdownMessage}`; + await notifications.alert(notifications.ALERT_DISK_SPACE, 'Server is running out of disk space', finalMessage, { persist: true }); + } else { + await notifications.clearAlert(notifications.ALERT_DISK_SPACE, 'Server is running out of disk space'); + } } async function getSwapSize() {