From 96b6daf67802be02e41970a88f6574bed3fcb638 Mon Sep 17 00:00:00 2001 From: andig Date: Wed, 22 Mar 2023 21:36:35 +0100 Subject: [PATCH] Planner: improve logging for short slots (#7007) --- core/loadpoint_plan.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/loadpoint_plan.go b/core/loadpoint_plan.go index 2a9aa7c28..e500b2bfa 100644 --- a/core/loadpoint_plan.go +++ b/core/loadpoint_plan.go @@ -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 }