Due to the current implementation of the boot process using this invocation style:
javascript
module.exports = function someBootScript(app) {
// Init models, ...
// Setup relationships
// Other async stuff
};
it is currently not really possible (in a clean way) to have loopback wait with accepting requests until complete finalisation of the boot process. Some asynchronous operations may not yet have finished.
Please adjust this to something like:
module.exports = function someAsyncBootScript(app, done) {
// Init models, ...
// Setup relationships
// Other async stuff that calls done() when ready.
};
And only start the listener after this... It should be fairly easy to implement this using Q.all()...
Due to the current implementation of the boot process using this invocation style:
it is currently not really possible (in a clean way) to have loopback wait with accepting requests until complete finalisation of the boot process. Some asynchronous operations may not yet have finished.
Please adjust this to something like:
And only start the listener after this... It should be fairly easy to implement this using Q.all()...