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
+8 -2
View File
@@ -236,8 +236,14 @@ function appUpdated(eventId, app, callback) {
assert.strictEqual(typeof callback, 'function');
actionForAllAdmins([], function (admin, done) {
mailer.appUpdated(admin.email, app);
add(admin.id, eventId, `App ${app.fqdn} updated`, `The application ${app.manifest.title} installed at https://${app.fqdn} was updated to package version ${app.manifest.version}.`, done);
add(admin.id, eventId, `App ${app.fqdn} updated`, `The application ${app.manifest.title} installed at https://${app.fqdn} was updated to package version ${app.manifest.version}.`, function (error) {
if (error) return callback(error);
mailer.appUpdated(admin.email, app, function (error) {
if (error) console.error('Failed to send app updated email', error); // non fatal
done();
});
});
}, callback);
}