mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 03:39:55 +00:00
Wait till all node_helper are started before finishing startup (#2928)
In response to #2487 this implements a Promise.all for the node_helper start calls Co-authored-by: veeck <michael@veeck.de>
This commit is contained in:
parent
1eb2965b2b
commit
7bbf8c19db
@ -23,6 +23,7 @@ Special thanks to: @rejas, @sdetweil
|
|||||||
### Updated
|
### Updated
|
||||||
|
|
||||||
- Cleaned up test directory
|
- Cleaned up test directory
|
||||||
|
- Wait for all modules to start before declaring the system ready (#2487)
|
||||||
- Updated e2e tests (moved `done()` in helper functions) and use es6 syntax in all tests
|
- Updated e2e tests (moved `done()` in helper functions) and use es6 syntax in all tests
|
||||||
- Updated da translation
|
- Updated da translation
|
||||||
- Rework weather module
|
- Rework weather module
|
||||||
|
14
js/app.js
14
js/app.js
@ -226,17 +226,21 @@ function App() {
|
|||||||
httpServer = new Server(config, function (app, io) {
|
httpServer = new Server(config, function (app, io) {
|
||||||
Log.log("Server started ...");
|
Log.log("Server started ...");
|
||||||
|
|
||||||
|
const nodePromises = [];
|
||||||
|
|
||||||
for (let nodeHelper of nodeHelpers) {
|
for (let nodeHelper of nodeHelpers) {
|
||||||
nodeHelper.setExpressApp(app);
|
nodeHelper.setExpressApp(app);
|
||||||
nodeHelper.setSocketIO(io);
|
nodeHelper.setSocketIO(io);
|
||||||
nodeHelper.start();
|
nodePromises.push(nodeHelper.start());
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.log("Sockets connected & modules started ...");
|
Promise.allSettled(nodePromises).then(() => {
|
||||||
|
Log.log("Sockets connected & modules started ...");
|
||||||
|
|
||||||
if (typeof callback === "function") {
|
if (typeof callback === "function") {
|
||||||
callback(config);
|
callback(config);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user