fix: address code review findings

This commit is contained in:
2026-08-17 20:34:17 +03:00
parent 0bba23692c
commit 82757665e9
6 changed files with 28 additions and 33 deletions

View File

@@ -1068,7 +1068,7 @@ func (g *Graph) checkRouteForChanges(itinerary *Itinerary) bool {
break
}
// Check for significant delay (more than 2x normal duration)
if edge.Duration > leg.Cost*2 && leg.Cost > 0 { // simplified delay check
if edge.Duration > leg.Duration*2 && leg.Duration > 0 {
if !needsReSearch || itinerary.ReSearchReason == string(reasonNone) {
needsReSearch = true
itinerary.NeedsReSearch = true