notifications: use clearAlert to clear disk space message

This commit is contained in:
Girish Ramakrishnan
2023-03-26 17:02:44 +02:00
parent 119c987837
commit 295c74a7a9

View File

@@ -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() {