@iobroker/db-states-jsonl
Advanced tools
Comparing version 1.1.5 to 1.2.0
/** | ||
* States DB in memory - Server | ||
* | ||
* Copyright 2013-2018 bluefox <dogafox@gmail.com> | ||
* Copyright 2013-2021 bluefox <dogafox@gmail.com> | ||
* | ||
@@ -17,5 +17,5 @@ * MIT License | ||
const StatesInMemoryFileDB = require('@iobroker/db-states-file').StatesInMemoryFileDB; | ||
const { JsonlDB } = require('@alcalzone/jsonl-db'); | ||
const path = require('path'); | ||
const StatesInMemoryFileDB = require('@iobroker/db-states-file').StatesInMemoryFileDB; | ||
const { JsonlDB } = require('@alcalzone/jsonl-db'); | ||
const path = require('path'); | ||
@@ -22,0 +22,0 @@ // settings = { |
/** | ||
* States DB in memory - Server with Redis protocol | ||
* | ||
* Copyright 2013-2020 bluefox <dogafox@gmail.com> | ||
* Copyright 2013-2021 bluefox <dogafox@gmail.com> | ||
* | ||
@@ -18,3 +18,3 @@ * MIT License | ||
const StatesInRedisClient = require('@iobroker/db-states-redis').Client; | ||
const StatesInMemServer = require('./statesInMemServerRedis'); | ||
const StatesInMemServer = require('./statesInMemServerRedis'); | ||
@@ -21,0 +21,0 @@ class StatesInMemoryServerClass extends StatesInRedisClient { |
/** | ||
* States DB in memory - Server with Redis protocol | ||
* | ||
* Copyright 2013-2020 bluefox <dogafox@gmail.com> | ||
* Copyright 2013-2021 bluefox <dogafox@gmail.com> | ||
* | ||
@@ -16,6 +16,6 @@ * MIT License | ||
'use strict'; | ||
const net = require('net'); | ||
const net = require('net'); | ||
const { inspect } = require('util'); | ||
const RedisHandler = require('@iobroker/db-base').redisHandler; | ||
const RedisHandler = require('@iobroker/db-base').redisHandler; | ||
const StatesInMemoryJsonlDB = require('./statesInMemJsonlDB'); | ||
@@ -69,3 +69,3 @@ | ||
}).then(() => { | ||
this.log.debug(this.namespace + ' ' + (settings.secure ? 'Secure ' : '') + ' Redis inMem-states listening on port ' + (this.settings.port || 9000)); | ||
this.log.debug(`${this.namespace} ${settings.secure ? 'Secure ' : ''} Redis inMem-states listening on port ${this.settings.port || 9000}`); | ||
@@ -76,3 +76,3 @@ if (typeof this.settings.connected === 'function') { | ||
}).catch(e => { | ||
this.log.error(this.namespace + ' Cannot start inMem-states on port ' + (this.settings.port || 9000) + ': ' + e.message); | ||
this.log.error(`${this.namespace} Cannot start inMem-states on port ${this.settings.port || 9000}: ${e.message}`); | ||
process.exit(24); // todo: replace it with exitcode | ||
@@ -169,3 +169,3 @@ }); | ||
infoString += '# Keyspace\r\n'; | ||
infoString += 'db0:keys=' + Object.keys(this.dataset).length + ',expires=' + (Object.keys(this.stateExpires).length + Object.keys(this.sessionExpires).length) + ',avg_ttl=98633637897'; | ||
infoString += `db0:keys=${Object.keys(this.dataset).length},expires=${Object.keys(this.stateExpires).length + Object.keys(this.sessionExpires).length},avg_ttl=98633637897`; | ||
handler.sendBulk(responseId, infoString); | ||
@@ -204,6 +204,6 @@ }); | ||
} catch (err) { | ||
handler.sendError(responseId, new Error('ERROR _getStates: ' + err.message)); | ||
handler.sendError(responseId, new Error(`ERROR _getStates: ${err.message}`)); | ||
} | ||
} else { | ||
handler.sendError(responseId, new Error('MGET-UNSUPPORTED for namespace ' + namespace + ': Data=' + JSON.stringify(data))); | ||
handler.sendError(responseId, new Error(`MGET-UNSUPPORTED for namespace ${namespace}: Data=${JSON.stringify(data)}`)); | ||
} | ||
@@ -234,3 +234,3 @@ }); | ||
} else { | ||
handler.sendError(responseId, new Error('GET-UNSUPPORTED for namespace ' + namespace + ': Data=' + JSON.stringify(data))); | ||
handler.sendError(responseId, new Error(`GET-UNSUPPORTED for namespace ${namespace}: Data=${JSON.stringify(data)}`)); | ||
} | ||
@@ -254,6 +254,6 @@ }); | ||
} catch (err) { | ||
handler.sendError(responseId, new Error('ERROR setState id=' + id + ': ' + err.message)); | ||
handler.sendError(responseId, new Error(`ERROR setState id=${id}: ${err.message}`)); | ||
} | ||
} else { | ||
handler.sendError(responseId, new Error('SET-UNSUPPORTED for namespace ' + namespace + ': Data=' + JSON.stringify(data))); | ||
handler.sendError(responseId, new Error(`SET-UNSUPPORTED for namespace ${namespace}: Data=${JSON.stringify(data)}`)); | ||
} | ||
@@ -275,3 +275,3 @@ }); | ||
if (isNaN(expire)) { | ||
return void handler.sendError(responseId, new Error('ERROR parsing expire value ' + data[1].toString('utf-8'))); | ||
return void handler.sendError(responseId, new Error(`ERROR parsing expire value ${data[1].toString('utf-8')}`)); | ||
} | ||
@@ -281,3 +281,3 @@ this._setStateDirect(id, state, expire); | ||
} catch (err) { | ||
handler.sendError(responseId, new Error('ERROR setStateEx id=' + id + ': ' + err.message)); | ||
handler.sendError(responseId, new Error(`ERROR setStateEx id=${id}: ${err.message}`)); | ||
} | ||
@@ -289,3 +289,3 @@ } else if (namespace === this.namespaceSession) { | ||
if (isNaN(expire)) { | ||
return void handler.sendError(responseId, new Error('ERROR parsing expire value ' + data[1].toString('utf-8'))); | ||
return void handler.sendError(responseId, new Error(`ERROR parsing expire value ${data[1].toString('utf-8')}`)); | ||
} | ||
@@ -295,6 +295,6 @@ this._setSession(id, expire, state); | ||
} catch (err) { | ||
handler.sendError(responseId, new Error('ERROR _setSession ' + id + ': ' + err.message)); | ||
handler.sendError(responseId, new Error(`ERROR _setSession ${id}: ${err.message}`)); | ||
} | ||
} else { | ||
handler.sendError(responseId, new Error('SETEX-UNSUPPORTED for namespace ' + namespace + ': Data=' + JSON.stringify(data))); | ||
handler.sendError(responseId, new Error(`SETEX-UNSUPPORTED for namespace ${namespace}: Data=${JSON.stringify(data)}`)); | ||
} | ||
@@ -313,3 +313,3 @@ }); | ||
} else { | ||
handler.sendError(responseId, new Error('DEL-UNSUPPORTED for namespace ' + namespace + ': Data=' + JSON.stringify(data))); | ||
handler.sendError(responseId, new Error(`DEL-UNSUPPORTED for namespace ${namespace}: Data=${JSON.stringify(data)}`)); | ||
} | ||
@@ -334,3 +334,3 @@ }); | ||
} else { | ||
handler.sendError(responseId, new Error('KEYS-UNSUPPORTED for namespace ' + namespace + ': Data=' + JSON.stringify(data))); | ||
handler.sendError(responseId, new Error(`KEYS-UNSUPPORTED for namespace ${namespace}: Data=${JSON.stringify(data)}`)); | ||
} | ||
@@ -352,3 +352,3 @@ }); | ||
} else { | ||
handler.sendError(responseId, new Error('PSUBSCRIBE-UNSUPPORTED for namespace ' + namespace + ': Data=' + JSON.stringify(data))); | ||
handler.sendError(responseId, new Error(`PSUBSCRIBE-UNSUPPORTED for namespace ${namespace}: Data=${JSON.stringify(data)}`)); | ||
} | ||
@@ -370,3 +370,3 @@ }); | ||
} else { | ||
handler.sendError(responseId, new Error('PUNSUBSCRIBE-UNSUPPORTED for namespace ' + namespace + ': Data=' + JSON.stringify(data))); | ||
handler.sendError(responseId, new Error(`PUNSUBSCRIBE-UNSUPPORTED for namespace ${namespace}: Data=${JSON.stringify(data)}`)); | ||
} | ||
@@ -381,3 +381,3 @@ }); | ||
} else { | ||
handler.sendError(responseId, new Error('SUBSCRIBE-UNSUPPORTED for ' + data[0])); | ||
handler.sendError(responseId, new Error(`SUBSCRIBE-UNSUPPORTED for ${data[0]}`)); | ||
} | ||
@@ -458,3 +458,3 @@ }); | ||
_initSocket(socket) { | ||
this.settings.connection.enhancedLogging && this.log.silly(this.namespace + ' Handling new Redis States connection'); | ||
this.settings.connection.enhancedLogging && this.log.silly(`${this.namespace} Handling new Redis States connection`); | ||
@@ -461,0 +461,0 @@ const options = { |
{ | ||
"name": "@iobroker/db-states-jsonl", | ||
"version": "1.1.5", | ||
"version": "1.2.0", | ||
"engines": { | ||
@@ -9,5 +9,5 @@ "node": ">=10.0.0" | ||
"@alcalzone/jsonl-db": "^1.2.3", | ||
"@iobroker/db-base": "1.1.4", | ||
"@iobroker/db-states-file": "1.1.4", | ||
"@iobroker/db-states-redis": "1.1.4" | ||
"@iobroker/db-base": "1.2.0", | ||
"@iobroker/db-states-file": "1.2.0", | ||
"@iobroker/db-states-redis": "1.2.0" | ||
}, | ||
@@ -35,3 +35,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "278753f72d34a83a82f33c938a286d574975151c" | ||
"gitHead": "31a8cce837dc360eec0f40f6ac6f50247c4fac9a" | ||
} |
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
29222
+ Added@iobroker/db-base@1.2.0(transitive)
+ Added@iobroker/db-states-file@1.2.0(transitive)
+ Added@iobroker/db-states-redis@1.2.0(transitive)
- Removed@iobroker/db-base@1.1.4(transitive)
- Removed@iobroker/db-states-file@1.1.4(transitive)
- Removed@iobroker/db-states-redis@1.1.4(transitive)
Updated@iobroker/db-base@1.2.0