New field to disable a repeated alarm
This commit is contained in:
parent
45efc3601e
commit
5526940e61
4 changed files with 13 additions and 1 deletions
|
|
@ -149,6 +149,7 @@ type AlarmRepeated struct {
|
|||
FollowingRoutines []Identifier `json:"routines"`
|
||||
IgnoreExceptions bool `json:"ignore_exceptions"`
|
||||
Comment string `json:"comment,omitempty"`
|
||||
Disabled bool `json:"disabled,omitempty"`
|
||||
Excepts Exceptions `json:"excepts,omitempty"`
|
||||
NextTime *time.Time `json:"next_time,omitempty"`
|
||||
}
|
||||
|
|
@ -185,6 +186,10 @@ func (a *AlarmRepeated) FillExcepts(cfg *config.Config, db *LevelDBStorage) erro
|
|||
}
|
||||
|
||||
func (a *AlarmRepeated) GetNextOccurence(cfg *config.Config, db *LevelDBStorage) *time.Time {
|
||||
if a.Disabled {
|
||||
return nil
|
||||
}
|
||||
|
||||
if len(a.Excepts) == 0 {
|
||||
a.FillExcepts(cfg, db)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue