@iobroker/db-base 4.0.7 → 4.0.9-alpha.4-20220211-0162da93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/inMemFileDB.js +9 -0
- package/package.json +3 -3
package/lib/inMemFileDB.js
CHANGED
|
@@ -178,6 +178,15 @@ class InMemoryFileDB {
|
|
|
178
178
|
if (isNaN(this.settings.backup.period)) {
|
|
179
179
|
this.settings.backup.period = 120;
|
|
180
180
|
}
|
|
181
|
+
// Node.js timeouts overflow after roughly 24 days, defaulting to 1 millisecond, which causes chaos.
|
|
182
|
+
// If a user configured the backup this way, we use our default of 120 minutes instead.
|
|
183
|
+
const maxTimeoutMinutes = Math.floor((2 ** 31 - 1) / 60000);
|
|
184
|
+
if (this.settings.backup.period > maxTimeoutMinutes) {
|
|
185
|
+
this.settings.backup.period = 120;
|
|
186
|
+
this.log.warning(
|
|
187
|
+
`${this.namespace} Configured backup period ${this.settings.backup.period} is larger than the supported maximum of ${maxTimeoutMinutes} minutes. Defaulting to 120 minutes.`
|
|
188
|
+
);
|
|
189
|
+
}
|
|
181
190
|
this.settings.backup.period *= 60000;
|
|
182
191
|
|
|
183
192
|
this.settings.backup.files =
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iobroker/db-base",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.9-alpha.4-20220211-0162da93",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=12.0.0"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@iobroker/js-controller-common": "4.0.
|
|
8
|
+
"@iobroker/js-controller-common": "4.0.9-alpha.4-20220211-0162da93",
|
|
9
9
|
"deep-clone": "^3.0.3",
|
|
10
10
|
"fs-extra": "^10.0.0",
|
|
11
11
|
"respjs": "^4.2.0"
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"lib/",
|
|
36
36
|
"index.js"
|
|
37
37
|
],
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "7510e897ead1d3c24b8fc5e79e6e95bbca2143ae"
|
|
39
39
|
}
|