From 5619010838d3220b0119c99b2c78c84141d0fc85 Mon Sep 17 00:00:00 2001 From: mr Date: Fri, 20 Mar 2026 14:01:14 +0100 Subject: [PATCH] correct time loc --- models/common/planner.go | 9 +-------- models/resources/priced_resource.go | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/models/common/planner.go b/models/common/planner.go index 7312476..7238876 100755 --- a/models/common/planner.go +++ b/models/common/planner.go @@ -33,14 +33,7 @@ func GetPlannerLongestTime(end *time.Time, planned map[tools.DataType]map[string } longestTime := float64(0) for _, priced := range planned[tools.PROCESSING_RESOURCE] { - if priced.GetLocationEnd() == nil { - continue - } - newS := priced.GetLocationEnd() - if end == nil && longestTime < newS.Sub(*end).Seconds() { - longestTime = newS.Sub(*end).Seconds() - } - // get the nearest start from start var + longestTime += priced.GetExplicitDurationInS() } return longestTime } diff --git a/models/resources/priced_resource.go b/models/resources/priced_resource.go index c7b7193..59c5e10 100755 --- a/models/resources/priced_resource.go +++ b/models/resources/priced_resource.go @@ -117,7 +117,7 @@ func (abs *PricedResource[T]) GetExplicitDurationInS() float64 { } if abs.BookingConfiguration.ExplicitBookingDurationS == 0 { if abs.BookingConfiguration.UsageEnd == nil && abs.BookingConfiguration.UsageStart == nil { - return (1 * time.Hour).Seconds() + return (5 * time.Minute).Seconds() } if abs.BookingConfiguration.UsageEnd == nil { add := abs.BookingConfiguration.UsageStart.Add(5 * time.Minute)