From 707e0191217c4075c3a153dcdeabb06e3c6812fb Mon Sep 17 00:00:00 2001 From: Michael Kutzner <174690291+MichaelKutzner@users.noreply.github.com> Date: Thu, 21 Nov 2024 11:50:26 +0100 Subject: [PATCH] Change unit to minutes --- openapi.yaml | 4 ++-- src/endpoints/routing.cc | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index bc4718dc1..58d71c181 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -363,7 +363,7 @@ paths: in: query required: false description: | - The maximum travel time in hours. + The maximum travel time in minutes. If not provided, the routing to uses the value hardcoded in the server which is usually quite high. @@ -372,7 +372,7 @@ paths: If this value is too low to reach the destination at all, it can lead to slow routing performance. schema: - type: number + type: integer - name: minTransferTime in: query diff --git a/src/endpoints/routing.cc b/src/endpoints/routing.cc index cc336d32f..9906581d2 100644 --- a/src/endpoints/routing.cc +++ b/src/endpoints/routing.cc @@ -1,6 +1,6 @@ #include "motis/endpoints/routing.h" -#include +#include #include "boost/thread/tss.hpp" @@ -296,11 +296,11 @@ stats_map_t join(auto&&... maps) { // Get cutoff to remove journeys with slower or equal duration std::optional calculate_search_cutoff_time( n::duration_t const fastest_direct, - std::optional const& max_travel_time) { + std::optional const& max_travel_time) { if (max_travel_time.has_value()) { // Add +1 to keep journeys with equal duration auto const max_travel_duration = - n::duration_t{std::lround(60 * *max_travel_time) + 1}; + n::duration_t{*max_travel_time + 1}; return fastest_direct == kInfinityDuration ? max_travel_duration : std::min(fastest_direct, max_travel_duration);