@iobroker/js-controller-common 4.0.7 → 4.0.8-alpha.0-20220211-7f8106a5
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/common/tools.js +6 -2
- package/package.json +2 -2
package/lib/common/tools.js
CHANGED
|
@@ -215,11 +215,15 @@ async function isSingleHost(objects) {
|
|
|
215
215
|
* @return Promise<boolean> true if one or more hosts running else false
|
|
216
216
|
*/
|
|
217
217
|
async function isHostRunning(objects, states) {
|
|
218
|
-
|
|
218
|
+
// do it without object view for now, can be reverted if no one downgrades to < 4 (redis-sets)
|
|
219
|
+
// const res = await objects.getObjectViewAsync('system', 'host', { startkey: '', endkey: '\u9999' });
|
|
220
|
+
|
|
221
|
+
const res = await objects.getObjectList({ startkey: 'system.host.', endkey: 'system.host.\u9999' });
|
|
222
|
+
res.rows = res.rows.filter(obj => obj.value && obj.value.type === 'host');
|
|
219
223
|
|
|
220
224
|
for (const hostObj of res.rows) {
|
|
221
225
|
const state = await states.getState(`${hostObj.id}.alive`);
|
|
222
|
-
if (state.val) {
|
|
226
|
+
if (state && state.val) {
|
|
223
227
|
return true;
|
|
224
228
|
}
|
|
225
229
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iobroker/js-controller-common",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.8-alpha.0-20220211-7f8106a5",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=12.0.0"
|
|
6
6
|
},
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"lib/",
|
|
48
48
|
"index.js"
|
|
49
49
|
],
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "455a43ce329d9c140b817813948f95431493f597"
|
|
51
51
|
}
|