Update cycle count regularly
This commit is contained in:
parent
fffdccc7b8
commit
b7dbc597d8
4 changed files with 46 additions and 9 deletions
|
|
@ -57,8 +57,9 @@ func GetNextAlarm(db *LevelDBStorage) (*time.Time, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
now := time.Now()
|
||||
for _, alarm := range alarmsSingle {
|
||||
if closestAlarm == nil || closestAlarm.After(alarm.Time) {
|
||||
if closestAlarm == nil || (closestAlarm.After(alarm.Time) && alarm.Time.After(now)) {
|
||||
closestAlarm = &alarm.Time
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue