@@ -15,6 +15,7 @@ exports = module.exports = {
|
||||
unexpectedExit: unexpectedExit,
|
||||
|
||||
appDied: appDied,
|
||||
oomEvent: oomEvent,
|
||||
|
||||
outOfDiskSpace: outOfDiskSpace,
|
||||
backupFailed: backupFailed,
|
||||
@@ -499,6 +500,24 @@ function certificateRenewalError(domain, message) {
|
||||
});
|
||||
}
|
||||
|
||||
function oomEvent(program, context) {
|
||||
assert.strictEqual(typeof program, 'string');
|
||||
assert.strictEqual(typeof context, 'string');
|
||||
|
||||
getAdminEmails(function (error, adminEmails) {
|
||||
if (error) return console.log('Error getting admins', error);
|
||||
|
||||
var mailOptions = {
|
||||
from: mailConfig().from,
|
||||
to: config.provider() === 'caas' ? 'support@cloudron.io' : adminEmails.concat('support@cloudron.io').join(', '),
|
||||
subject: util.format('[%s] %s exited unexpectedly', config.fqdn(), program),
|
||||
text: render('oom_event.ejs', { fqdn: config.fqdn(), program: program, context: context, format: 'text' })
|
||||
};
|
||||
|
||||
sendMails([ mailOptions ]);
|
||||
});
|
||||
}
|
||||
|
||||
// this function bypasses the queue intentionally. it is also expected to work without the mailer module initialized
|
||||
// NOTE: crashnotifier should be able to send mail when there is no db
|
||||
function unexpectedExit(program, context) {
|
||||
|
||||
Reference in New Issue
Block a user