@iobroker/db-states-file
Advanced tools
Comparing version 5.0.20-alpha.0-20240323-74044f09 to 5.0.20-alpha.0-20240326-1f96ea5e
@@ -8,2 +8,3 @@ export = StatesInMemoryFileDB; | ||
constructor(settings: any); | ||
META_ID: string; | ||
logs: {}; | ||
@@ -10,0 +11,0 @@ session: {}; |
@@ -13,2 +13,3 @@ "use strict"; | ||
super(settings); | ||
this.META_ID = "**META**"; | ||
this.logs = {}; | ||
@@ -83,6 +84,6 @@ this.session = {}; | ||
_ensureMetaDict() { | ||
let meta = this.dataset["**META**"]; | ||
let meta = this.dataset[this.META_ID]; | ||
if (!meta) { | ||
meta = {}; | ||
this.dataset["**META**"] = meta; | ||
this.dataset[this.META_ID] = meta; | ||
} | ||
@@ -98,3 +99,3 @@ return meta; | ||
meta[id] = value; | ||
this.dataset["**META**"] = meta; | ||
this.dataset[this.META_ID] = meta; | ||
setImmediate(() => { | ||
@@ -151,3 +152,3 @@ this.log.silly(`${this.namespace} memory publish meta ${id} ${value}`); | ||
const r = new RegExp(tools.pattern2RegEx(pattern)); | ||
return Object.keys(this.dataset).filter((id) => r.test(id)); | ||
return Object.keys(this.dataset).filter((id) => r.test(id) && id !== this.META_ID); | ||
} | ||
@@ -154,0 +155,0 @@ _subscribeForClient(client, pattern) { |
@@ -8,2 +8,3 @@ export = StatesInMemoryFileDB; | ||
constructor(settings: any); | ||
META_ID: string; | ||
logs: {}; | ||
@@ -10,0 +11,0 @@ session: {}; |
@@ -49,13 +49,14 @@ /** | ||
super(settings); | ||
this.META_ID = '**META**'; | ||
this.logs = {}; | ||
this.session = {}; | ||
this.globalMessageId = Math.round(Math.random() * 100000000); | ||
this.globalLogId = Math.round(Math.random() * 100000000); | ||
this.globalMessageId = Math.round(Math.random() * 100_000_000); | ||
this.globalLogId = Math.round(Math.random() * 100_000_000); | ||
this.stateExpires = {}; | ||
this.sessionExpires = {}; | ||
this.ONE_DAY_IN_SECS = 24 * 60 * 60 * 1000; | ||
this.ONE_DAY_IN_SECS = 24 * 60 * 60 * 1_000; | ||
this.writeFileInterval = | ||
this.settings.connection && typeof this.settings.connection.writeFileInterval === 'number' | ||
? parseInt(this.settings.connection.writeFileInterval) | ||
: 30000; | ||
: 30_000; | ||
if (settings.jsonlDB) { | ||
@@ -132,6 +133,6 @@ this.log.silly(`${this.namespace} States DB uses file write interval of ${this.writeFileInterval} ms`); | ||
_ensureMetaDict() { | ||
let meta = this.dataset['**META**']; | ||
let meta = this.dataset[this.META_ID]; | ||
if (!meta) { | ||
meta = {}; | ||
this.dataset['**META**'] = meta; | ||
this.dataset[this.META_ID] = meta; | ||
} | ||
@@ -160,3 +161,3 @@ return meta; | ||
// Make sure the object gets re-written, especially when using an external DB | ||
this.dataset['**META**'] = meta; | ||
this.dataset[this.META_ID] = meta; | ||
setImmediate(() => { | ||
@@ -222,3 +223,3 @@ // publish event in states | ||
const r = new RegExp(tools.pattern2RegEx(pattern)); | ||
return Object.keys(this.dataset).filter(id => r.test(id)); | ||
return Object.keys(this.dataset).filter(id => r.test(id) && id !== this.META_ID); | ||
} | ||
@@ -225,0 +226,0 @@ // needed by Server |
{ | ||
"name": "@iobroker/db-states-file", | ||
"version": "5.0.20-alpha.0-20240323-74044f09", | ||
"version": "5.0.20-alpha.0-20240326-1f96ea5e", | ||
"engines": { | ||
@@ -8,4 +8,4 @@ "node": ">=12.0.0" | ||
"dependencies": { | ||
"@iobroker/db-base": "5.0.20-alpha.0-20240323-74044f09", | ||
"@iobroker/db-states-redis": "5.0.20-alpha.0-20240323-74044f09" | ||
"@iobroker/db-base": "5.0.20-alpha.0-20240326-1f96ea5e", | ||
"@iobroker/db-states-redis": "5.0.20-alpha.0-20240326-1f96ea5e" | ||
}, | ||
@@ -48,3 +48,3 @@ "keywords": [ | ||
], | ||
"gitHead": "487be77dd42776c1fb2635c309c0d7c64dcefe57" | ||
"gitHead": "b043ba922df87f3b0f03340c01c03a2a48e9f16b" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
209424
1809
2
+ Added@iobroker/db-base@5.0.20-alpha.0-20240326-1f96ea5e(transitive)
+ Added@iobroker/db-states-redis@5.0.20-alpha.0-20240326-1f96ea5e(transitive)
+ Added@iobroker/js-controller-common@5.0.20-alpha.0-20240326-1f96ea5e(transitive)
- Removed@iobroker/db-base@5.0.20-alpha.0-20240323-74044f09(transitive)
- Removed@iobroker/db-states-redis@5.0.20-alpha.0-20240323-74044f09(transitive)
- Removed@iobroker/js-controller-common@5.0.20-alpha.0-20240323-74044f09(transitive)
Updated@iobroker/db-states-redis@5.0.20-alpha.0-20240326-1f96ea5e