Add MOTIS server
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user