Do not callback early to avoid loosing emails

This commit is contained in:
Johannes Zellner
2019-05-07 14:22:51 +02:00
parent 23bfb7b8e6
commit a6ce5ce796
2 changed files with 11 additions and 4 deletions

View File

@@ -296,9 +296,10 @@ function appDied(mailTo, app) {
});
}
function appUpdated(mailTo, app) {
function appUpdated(mailTo, app, callback) {
assert.strictEqual(typeof mailTo, 'string');
assert.strictEqual(typeof app, 'object');
callback = callback || NOOP_CALLBACK;
debug('Sending mail for app %s @ %s updated', app.id, app.fqdn);
@@ -312,7 +313,7 @@ function appUpdated(mailTo, app) {
text: render('app_updated.ejs', { title: app.manifest.title, appFqdn: app.fqdn, version: app.manifest.version, format: 'text' })
};
sendMail(mailOptions);
sendMail(mailOptions, callback);
});
}