diff --git a/server/jobs/clear-old-data.js b/server/jobs/clear-old-data.js
index 0ec5ffa5f..ed80b0f74 100644
--- a/server/jobs/clear-old-data.js
+++ b/server/jobs/clear-old-data.js
@@ -25,15 +25,20 @@ const DEFAULT_KEEP_PERIOD = 180;
parsedPeriod = DEFAULT_KEEP_PERIOD;
}
- log(`Clearing Data older than ${parsedPeriod} days...`);
+ if (parsedPeriod < 1) {
+ log(`Data deletion has been disabled as period is less than 1. Period is ${parsedPeriod} days.`);
+ } else {
- try {
- await R.exec(
- "DELETE FROM heartbeat WHERE time < DATETIME('now', '-' || ? || ' days') ",
- [ parsedPeriod ]
- );
- } catch (e) {
- log(`Failed to clear old data: ${e.message}`);
+ log(`Clearing Data older than ${parsedPeriod} days...`);
+
+ try {
+ await R.exec(
+ "DELETE FROM heartbeat WHERE time < DATETIME('now', '-' || ? || ' days') ",
+ [ parsedPeriod ]
+ );
+ } catch (e) {
+ log(`Failed to clear old data: ${e.message}`);
+ }
}
exit();
diff --git a/src/components/settings/MonitorHistory.vue b/src/components/settings/MonitorHistory.vue
index c78c6aaf7..afcb7bc9e 100644
--- a/src/components/settings/MonitorHistory.vue
+++ b/src/components/settings/MonitorHistory.vue
@@ -7,6 +7,7 @@
settings.keepDataPeriodDays,
])
}}
+ {{ $t("infiniteRetention") }}
+
+ {{ $t("dataRetentionTimeError") }}
+