new grpc functions
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 34s

This commit is contained in:
2025-06-16 13:01:16 +02:00
parent 2f0a45ced0
commit d71da5accd
12 changed files with 472 additions and 220 deletions

View File

@@ -13,6 +13,7 @@ import (
)
func (h *Handler) GetDriverJourneys(departure *geojson.Feature, arrival *geojson.Feature, departureDate time.Time, noreturn bool) ([]*types.DriverJourney, error) {
log.Info().Time("departureDate", departureDate).Bool("noreturn", noreturn).Str("departure", departure.Properties.MustString("label")).Str("arrival", arrival.Properties.MustString("label")).Msg("calling GetDriverJourneys")
minDistance := h.Config.GetInt64("parameters.limits.distance.min")
maxDistance := h.Config.GetInt64("parameters.limits.distance.max")
day := int(departureDate.Weekday())
@@ -27,7 +28,6 @@ func (h *Handler) GetDriverJourneys(departure *geojson.Feature, arrival *geojson
}
for _, a := range availabilities {
log.Debug().Any("availability", a).Msg("Availability found")
if a.Address != nil {
var route *routing.Route
if noreturn {
@@ -55,8 +55,6 @@ func (h *Handler) GetDriverJourneys(departure *geojson.Feature, arrival *geojson
continue
}
log.Debug().Any("route", route).Msg("debug route")
passengerDistance := int64(route.Legs[1].Distance)
if !noreturn {
passengerDistance = passengerDistance + int64(route.Legs[2].Distance)
@@ -151,7 +149,6 @@ func (h Handler) ToggleDriverJourneyNoreturn(journeyid string) error {
journey.DriverDistance = int64(route.Distance)
journey.Duration = route.Legs[1].Duration
}
log.Debug().Any("journey", journey).Msg("journey update")
err = h.Storage.UpdateDriverJourney(*journey)
return err