Added error message when someone tries to access mailtrain while it is loading.

This prevents one to perform action on services that are still initializing (e.g. senders, where update of a send configuration causes config reload on the sender process, which may not be started yet and thus responds with error that send method is not defined)
This commit is contained in:
Tomas Bures 2018-11-24 01:49:01 -05:00
parent fa451fc8da
commit f21cea2aec
2 changed files with 40 additions and 20 deletions

View file

@ -92,37 +92,36 @@ dbcheck(err => { // Check if database needs upgrading before starting the server
*/
.then(() =>
executor.spawn(() => {
testServer(() => {
verpServer(() => {
startHTTPServer(AppType.TRUSTED, 'trusted', trustedPort, () => {
startHTTPServer(AppType.SANDBOXED, 'sandbox', sandboxPort, () => {
executor.spawn(() =>
testServer(() =>
verpServer(() =>
startHTTPServer(AppType.TRUSTED, 'trusted', trustedPort, () =>
startHTTPServer(AppType.SANDBOXED, 'sandbox', sandboxPort, () =>
startHTTPServer(AppType.PUBLIC, 'public', publicPort, () => {
privilegeHelpers.dropRootPrivileges();
tzupdate.start();
importer.spawn(() => {
feedcheck.spawn(() => {
importer.spawn(() =>
feedcheck.spawn(() =>
senders.spawn(() => {
triggers.start();
gdprCleanup.start();
postfixBounceServer(async () => {
(async () => {
await reportProcessor.init();
log.info('Service', 'All services started');
})();
await reportProcessor.init();
log.info('Service', 'All services started');
appBuilder.setReady();
});
});
});
});
});
});
});
});
});
})
})
)
);
})
)
)
)
)
)
);
});