mirror of
https://github.com/Xevion/go-ha.git
synced 2025-12-06 01:15:10 -06:00
refactor: remove internal priority_queue module, switch to Workiva implementation
This commit is contained in:
@@ -206,12 +206,15 @@ func (i Interval) maybeRunCallback(a *App) {
|
||||
}
|
||||
|
||||
func popInterval(a *App) Interval {
|
||||
i, _ := a.intervals.Pop()
|
||||
return i.(Interval)
|
||||
i, _ := a.intervals.Get(1)
|
||||
return i[0].(Item).Value.(Interval)
|
||||
}
|
||||
|
||||
func requeueInterval(a *App, i Interval) {
|
||||
i.nextRunTime = i.nextRunTime.Add(i.frequency)
|
||||
|
||||
a.intervals.Insert(i, float64(i.nextRunTime.Unix()))
|
||||
a.intervals.Put(Item{
|
||||
Value: i,
|
||||
Priority: float64(i.nextRunTime.Unix()),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user