Add MOTIS server
This commit is contained in:
@@ -52,8 +52,8 @@ func NewCarpoolRoutingHandler(cfg *viper.Viper) (*CarpoolRoutingHandler, error)
|
||||
}
|
||||
|
||||
// TODO add options (WithTimeDelta, etc...)
|
||||
func (h CarpoolRoutingHandler) Search(results chan *geojson.FeatureCollection, wg *sync.WaitGroup, departure geojson.Feature, destination geojson.Feature, departureDate time.Time) error {
|
||||
defer wg.Done()
|
||||
func (h CarpoolRoutingHandler) Search(results chan *geojson.FeatureCollection, departure geojson.Feature, destination geojson.Feature, departureDate time.Time) error {
|
||||
defer close(results)
|
||||
|
||||
defaultTimeDelta := 3600 * time.Second
|
||||
defaultDepartureRadius := int64(10)
|
||||
@@ -70,6 +70,7 @@ func (h CarpoolRoutingHandler) Search(results chan *geojson.FeatureCollection, w
|
||||
r, err := api.GetDriverJourneys(departure.Point().Lat(), departure.Point().Lon(), destination.Point().Lat(), destination.Point().Lon(), departureDate, &defaultTimeDelta, defaultDepartureRadius, defaultDestinationRadius, defaultCount)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Str("operator", api.GetOperatorId()).Msg("error in carpool api request")
|
||||
return
|
||||
}
|
||||
for _, journey := range r {
|
||||
// Departure
|
||||
|
||||
Reference in New Issue
Block a user