@iobroker/js-controller-cli 4.0.0-alpha.66-20220131-413a0962 → 4.0.0-alpha.67-20220131-6621d47f
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/cli/cliObjects.js +13 -2
- package/package.json +4 -4
package/lib/cli/cliObjects.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const CLI = require('./messages.js');
|
|
3
3
|
const CLICommand = require('./cliCommand.js');
|
|
4
4
|
const { formatValue } = require('./cliTools');
|
|
5
|
-
const { tools } = require('@iobroker/js-controller-common');
|
|
5
|
+
const { tools, EXIT_CODES } = require('@iobroker/js-controller-common');
|
|
6
6
|
|
|
7
7
|
/** Command iobroker object ... */
|
|
8
8
|
module.exports = class CLIObjects extends CLICommand {
|
|
@@ -56,9 +56,20 @@ module.exports = class CLIObjects extends CLICommand {
|
|
|
56
56
|
*/
|
|
57
57
|
activateSets() {
|
|
58
58
|
const { callback, dbConnect } = this.options;
|
|
59
|
-
dbConnect(async objects => {
|
|
59
|
+
dbConnect(async (objects, states) => {
|
|
60
60
|
if (!parseInt(await objects.getMeta('objects.features.useSets'))) {
|
|
61
|
+
// all hosts need to be stopped for this
|
|
62
|
+
if (await tools.isHostRunning(objects, states)) {
|
|
63
|
+
console.log('Cannot activate the usage of Redis Sets while one or more hosts are running');
|
|
64
|
+
return void callback(EXIT_CODES.CONTROLLER_RUNNING);
|
|
65
|
+
}
|
|
66
|
+
|
|
61
67
|
await objects.activateSets();
|
|
68
|
+
const noMigrated = await objects.migrateToSets();
|
|
69
|
+
|
|
70
|
+
if (noMigrated) {
|
|
71
|
+
console.log(`Successfully migrated ${noMigrated} objects to Redis Sets`);
|
|
72
|
+
}
|
|
62
73
|
console.log(
|
|
63
74
|
`Successfully activated the usage of Redis Sets. Please make sure to only use js-controller 4.0 or higher on all hosts!`
|
|
64
75
|
);
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iobroker/js-controller-cli",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.67-20220131-6621d47f",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=12.0.0"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@iobroker/js-controller-common": "4.0.0-alpha.
|
|
9
|
-
"@iobroker/js-controller-common-db": "4.0.0-alpha.
|
|
8
|
+
"@iobroker/js-controller-common": "4.0.0-alpha.67-20220131-6621d47f",
|
|
9
|
+
"@iobroker/js-controller-common-db": "4.0.0-alpha.67-20220131-6621d47f",
|
|
10
10
|
"chokidar": "^3.5.2",
|
|
11
11
|
"daemonize2": "^0.4.2",
|
|
12
12
|
"debug": "^4.3.3",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"lib/",
|
|
39
39
|
"index.js"
|
|
40
40
|
],
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "9079df08acfa9720e1e1747d3476950e7ec51ca5"
|
|
42
42
|
}
|