Skip to content

Commit

Permalink
Revert "Limit the search window to 24 hours"
Browse files Browse the repository at this point in the history
This reverts commit 0beef77.
  • Loading branch information
vpaturet committed Aug 24, 2023
1 parent 274bace commit 179ef19
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/ext/graphql/transmodelapi/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ type QueryType {
"""
relaxTransitSearchGeneralizedCostAtDestination: Float = null,
"""
The length of the search-window in minutes. This parameter is optional. The maximum value is 1440 minutes (24 hours).
The length of the search-window in minutes. This parameter is optional.
The search-window is defined as the duration between the earliest-departure-time(EDT) and the latest-departure-time(LDT). OTP will search for all itineraries in this departure window. If `arriveBy=true` the `dateTime` parameter is the latest-arrival-time, so OTP will dynamically calculate the EDT. Using a short search-window is faster than using a longer one, but the search duration is not linear. Using a "too" short search-window will waste resources server side, while using a search-window that is too long will be slow.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ public static GraphQLFieldDefinition create(
.newArgument()
.name("searchWindow")
.description(
"The length of the search-window in minutes. This parameter is optional. " +
"The maximum value is 1440 minutes (24 hours)." +
"The length of the search-window in minutes. This parameter is optional." +
"\n\n" +
"The search-window is defined as the duration between the earliest-departure-time(EDT) and " +
"the latest-departure-time(LDT). OTP will search for all itineraries in this departure " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Locale;
import java.util.function.Consumer;
import org.opentripplanner.framework.time.DateUtils;
import org.opentripplanner.framework.time.TimeUtils;
import org.opentripplanner.model.GenericLocation;
import org.opentripplanner.model.plan.SortOrder;
import org.opentripplanner.model.plan.pagecursor.PageCursor;
Expand Down Expand Up @@ -320,9 +319,6 @@ public Duration searchWindow() {
}

public void setSearchWindow(Duration searchWindow) {
if (searchWindow != null && searchWindow.toSeconds() > TimeUtils.ONE_DAY_SECONDS) {
throw new IllegalArgumentException("The search window cannot exceed 24 hours");
}
this.searchWindow = searchWindow;
}

Expand Down

0 comments on commit 179ef19

Please sign in to comment.