Skip to content

Commit

Permalink
fix(dao): warn if lastEvent is missing on an alarm (JS-45)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Oct 24, 2019
1 parent efe6858 commit e4af27d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/dao/AlarmDAO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,12 @@ export class AlarmDAO extends AbstractDAO<number, OnmsAlarm> {
alarm.uei = data.uei;
alarm.description = data.description;
alarm.firstEventTime = this.toDate(data.firstEventTime);

if (!data.lastEvent) {
log.warn(`"lastEvent" missing on alarm id={alarm.id}.`);
}
alarm.lastEvent = this.eventDao.fromData(data.lastEvent);

alarm.location = data.location;
alarm.logMessage = data.logMessage;
alarm.reductionKey = data.reductionKey;
Expand Down

0 comments on commit e4af27d

Please sign in to comment.