@iobroker/db-objects-jsonl 4.0.5 → 4.0.6-alpha.0-20220209-3a6580b2
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.
|
@@ -189,6 +189,12 @@ class ObjectsInMemoryJsonlDB extends ObjectsInMemoryFileDB {
|
|
|
189
189
|
this.backupDir,
|
|
190
190
|
`${this.getTimeStr(now)}_${this.settings.jsonlDB.fileName}.gz`
|
|
191
191
|
);
|
|
192
|
+
|
|
193
|
+
if (!this._db.isOpen) {
|
|
194
|
+
this.log.warn(`${this.namespace} Cannot save backup ${backupFileName}: DB is closed`);
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
|
|
192
198
|
try {
|
|
193
199
|
if (fs.existsSync(backupFileName)) {
|
|
194
200
|
return;
|
|
@@ -208,12 +214,12 @@ class ObjectsInMemoryJsonlDB extends ObjectsInMemoryFileDB {
|
|
|
208
214
|
async destroy() {
|
|
209
215
|
await super.destroy();
|
|
210
216
|
|
|
211
|
-
if (this._db) {
|
|
212
|
-
await this._db.close();
|
|
213
|
-
}
|
|
214
217
|
if (this._backupInterval) {
|
|
215
218
|
clearInterval(this._backupInterval);
|
|
216
219
|
}
|
|
220
|
+
if (this._db) {
|
|
221
|
+
await this._db.close();
|
|
222
|
+
}
|
|
217
223
|
}
|
|
218
224
|
}
|
|
219
225
|
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iobroker/db-objects-jsonl",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.6-alpha.0-20220209-3a6580b2",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=12.0.0"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@alcalzone/jsonl-db": "~2.4.
|
|
9
|
-
"@iobroker/db-base": "4.0.
|
|
10
|
-
"@iobroker/db-objects-file": "4.0.
|
|
11
|
-
"@iobroker/db-objects-redis": "4.0.
|
|
8
|
+
"@alcalzone/jsonl-db": "~2.4.3",
|
|
9
|
+
"@iobroker/db-base": "4.0.6-alpha.0-20220209-3a6580b2",
|
|
10
|
+
"@iobroker/db-objects-file": "4.0.6-alpha.0-20220209-3a6580b2",
|
|
11
|
+
"@iobroker/db-objects-redis": "4.0.6-alpha.0-20220209-3a6580b2",
|
|
12
12
|
"deep-clone": "^3.0.3",
|
|
13
13
|
"fs-extra": "^10.0.0"
|
|
14
14
|
},
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"lib/",
|
|
38
38
|
"index.js"
|
|
39
39
|
],
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "ce7aaf729286e88c7a82bca5d9b29c9581d308ba"
|
|
41
41
|
}
|