services: simplify startup logic

This commit is contained in:
Girish Ramakrishnan
2021-09-26 22:48:14 -07:00
parent 0415262305
commit 7ea9252059
3 changed files with 40 additions and 49 deletions

View File

@@ -28,7 +28,7 @@ exports = module.exports = {
setMailEnabled,
setBanner,
startMail: restartMail,
startMail,
restartMail,
handleCertChanged,
getMailAuth,
@@ -746,6 +746,12 @@ async function restartMail() {
await configureMail(settings.mailFqdn(), settings.dashboardDomain(), mailConfig);
}
async function startMail(existingInfra) {
assert.strictEqual(typeof existingInfra, 'object');
await restartMail();
}
async function restartMailIfActivated() {
const activated = await users.isActivated();