()
| 244 | } |
| 245 | |
| 246 | start() { |
| 247 | STARTED = 1; |
| 248 | //console.log(STARTED); |
| 249 | var clusterInit = Promise.all([ |
| 250 | getAllNodes(), |
| 251 | getAllTasks(), |
| 252 | getAllServices() |
| 253 | ]) |
| 254 | .then((resources) => { |
| 255 | _.remove(resources[1], (nc) => nc.state === 'Empty cluster' || nc.state === 'Terminated'); |
| 256 | return resources; |
| 257 | }); |
| 258 | |
| 259 | Promise.all([clusterInit]) |
| 260 | .then(([resources]) => { |
| 261 | PHYSICAL_STRUCT = physicalStructProvider(resources); |
| 262 | this.emit('infrastructure-data', PHYSICAL_STRUCT.data()); |
| 263 | this.emit('start-reload'); |
| 264 | }); |
| 265 | } |
| 266 | |
| 267 | reload() { |
| 268 | if (STARTED == 0) return; |
no test coverage detected