From 3b438c69a44e29b09f5b65edf4dd9325ac22529c Mon Sep 17 00:00:00 2001 From: andig Date: Fri, 30 Dec 2022 18:54:34 +0100 Subject: [PATCH] chore: log three digits --- core/planner/planner.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/planner/planner.go b/core/planner/planner.go index 126cd04b9..560dcb84d 100644 --- a/core/planner/planner.go +++ b/core/planner/planner.go @@ -28,7 +28,7 @@ func New(log *util.Logger, tariff api.Tariff) *Planner { // Plan creates a lowest-cost plan or required duration. // It MUST already established that -// - rates are sorted ascendingly by cost and start time +// - rates are sorted in ascending order by cost and descending order by start time (prefer late slots) // - target time and required duration are before end of rates func (t *Planner) Plan(rates api.Rates, requiredDuration time.Duration, targetTime time.Time) api.Rates { var plan api.Rates @@ -66,7 +66,7 @@ func (t *Planner) Plan(rates api.Rates, requiredDuration time.Duration, targetTi } plan = append(plan, slot) - t.log.TRACE.Printf(" slot from: %v to %v cost %.2f", slot.Start.Round(time.Second).Local(), slot.End.Round(time.Second).Local(), slot.Price) + t.log.TRACE.Printf(" slot from: %v to %v cost %.3f", slot.Start.Round(time.Second).Local(), slot.End.Round(time.Second).Local(), slot.Price) // we found all necessary slots if requiredDuration == 0 {