@iobroker/js-controller-common 4.0.7 → 4.0.9-alpha.4-20220211-0162da93

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.
@@ -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
- const res = await objects.getObjectViewAsync('system', 'host', { startkey: '', endkey: '\u9999' });
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.7",
3
+ "version": "4.0.9-alpha.4-20220211-0162da93",
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": "2237fea5948423f64650a3cc58286eec11335729"
50
+ "gitHead": "7510e897ead1d3c24b8fc5e79e6e95bbca2143ae"
51
51
  }