Add a timeout for update as well
this will send a notification if an update gets stuck
This commit is contained in:
@@ -17,6 +17,7 @@ exports = module.exports = {
|
||||
backupFailed: backupFailed,
|
||||
|
||||
certificateRenewalError: certificateRenewalError,
|
||||
boxUpdateError: boxUpdateError,
|
||||
|
||||
sendTestMail: sendTestMail,
|
||||
|
||||
@@ -411,6 +412,24 @@ function certificateRenewalError(mailTo, domain, message) {
|
||||
});
|
||||
}
|
||||
|
||||
function boxUpdateError(mailTo, message) {
|
||||
assert.strictEqual(typeof mailTo, 'string');
|
||||
assert.strictEqual(typeof message, 'string');
|
||||
|
||||
getMailConfig(function (error, mailConfig) {
|
||||
if (error) return debug('Error getting mail details:', error);
|
||||
|
||||
var mailOptions = {
|
||||
from: mailConfig.notificationFrom,
|
||||
to: mailTo,
|
||||
subject: util.format('[%s] Cloudron update error', mailConfig.cloudronName),
|
||||
text: render('box_update_error.ejs', { message: message, format: 'text' })
|
||||
};
|
||||
|
||||
sendMail(mailOptions);
|
||||
});
|
||||
}
|
||||
|
||||
function oomEvent(mailTo, program, event) {
|
||||
assert.strictEqual(typeof mailTo, 'string');
|
||||
assert.strictEqual(typeof program, 'string');
|
||||
|
||||
Reference in New Issue
Block a user