Planner: improve logging for short slots (#7007)

This commit is contained in:
andig 2023-03-22 21:36:35 +01:00 • committed by GitHub
parent 73076e8f8f
commit 96b6daf678
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -123,8 +123,9 @@ func (lp *Loadpoint) plannerActive() (active bool) {
if active {
// ignore short plans if not already active
if !lp.planActive && lp.clock.Until(activeSlot.End) < smallSlotDuration {
lp.log.DEBUG.Printf("plan too short- ignoring remaining %v", requiredDuration.Round(time.Second))
// TODO only ignore if the next adjacent slot is inactive, too
if slotRemaining := lp.clock.Until(activeSlot.End); !lp.planActive && slotRemaining < smallSlotDuration {
lp.log.DEBUG.Printf("plan slot too short- ignoring remaining %v", slotRemaining.Round(time.Second))
return false
}