Send app down notification through eventlog

This commit is contained in:
Johannes Zellner
2019-01-17 15:49:04 +01:00
parent 4ecb0d82e7
commit 701024cf80
3 changed files with 12 additions and 8 deletions

View File

@@ -19,6 +19,7 @@ exports = module.exports = {
ACTION_APP_UPDATE: 'app.update',
ACTION_APP_LOGIN: 'app.login',
ACTION_APP_OOM: 'app.oom',
ACTION_APP_DOWN: 'app.down',
ACTION_BACKUP_FINISH: 'backup.finish',
ACTION_BACKUP_START: 'backup.start',
@@ -106,7 +107,9 @@ function add(action, source, data, callback) {
} if (action === exports.ACTION_USER_UPDATE && data.adminStatusChanged) {
notifications.adminChanged(source.userId, data.user);
} if (action === exports.ACTION_APP_OOM) {
notifications.oomEvent(source.app ? source.app.id : source.containerId, data);
notifications.oomEvent(source.app ? source.app.id : source.containerId, { app: source.app, details: data });
} if (action === exports.ACTION_APP_DOWN) {
notifications.appDied(source.app);
} else {
// no notification
}