Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait till all node_helper are started before finishing startup #2928

Merged
merged 3 commits into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Special thanks to: @rejas, @sdetweil
### Updated

- 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 da translation
- Rework weather module
Expand Down
14 changes: 9 additions & 5 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,21 @@ function App() {
httpServer = new Server(config, function (app, io) {
Log.log("Server started ...");

const nodePromises = [];

for (let nodeHelper of nodeHelpers) {
nodeHelper.setExpressApp(app);
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") {
callback(config);
}
if (typeof callback === "function") {
callback(config);
}
});
});
});
});
Expand Down