Add MOTIS server

This commit is contained in:
2025-05-05 01:00:45 +02:00
parent 5f63e312c9
commit 8680f56006
9 changed files with 6829 additions and 17 deletions

View File

@@ -6,7 +6,6 @@ import (
"time"
"github.com/paulmach/orb/geojson"
"github.com/rs/zerolog/log"
"github.com/spf13/viper"
)
@@ -31,17 +30,16 @@ func (h *MultimodalRoutingHandler) Search(departure geojson.Feature, destination
var wg sync.WaitGroup
// Carpool
wg.Add(1)
go h.Carpool.Search(ch, &wg, departure, destination, departureDate)
go h.Carpool.Search(ch, departure, destination, departureDate)
wg.Add(1)
go func() {
wg.Wait()
close(ch)
defer wg.Done()
for journey := range ch {
journeys = append(journeys, journey)
}
}()
for journey := range ch {
log.Debug().Any("journey", journey).Msg("Received from channel")
journeys = append(journeys, journey)
}
wg.Wait()
return journeys, nil
}