File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
application/src/main/java/org/opentripplanner/routing/api/request/preference
main/java/org/opentripplanner/street/search/request
test/java/org/opentripplanner/street/search/request Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1212import org .opentripplanner .street .model .StreetMode ;
1313import org .opentripplanner .street .search .intersection_model .DrivingDirection ;
1414import org .opentripplanner .street .search .intersection_model .IntersectionTraversalModel ;
15+ import org .opentripplanner .street .search .request .StreetSearchRequest ;
1516import org .opentripplanner .utils .lang .DoubleUtils ;
1617import org .opentripplanner .utils .lang .Units ;
1718import org .opentripplanner .utils .tostring .ToStringBuilder ;
@@ -42,7 +43,7 @@ private StreetPreferences() {
4243 this .accessEgress = AccessEgressPreferences .DEFAULT ;
4344 this .intersectionTraversalModel = IntersectionTraversalModel .SIMPLE ;
4445 this .maxDirectDuration = durationForStreetModeOf (ofHours (4 ));
45- this .routingTimeout = Duration . ofSeconds ( 5 );
46+ this .routingTimeout = StreetSearchRequest . DEFAULT . timeout ( );
4647 }
4748
4849 private StreetPreferences (Builder builder ) {
Original file line number Diff line number Diff line change 2424 */
2525public class StreetSearchRequest implements AStarRequest {
2626
27- private static final StreetSearchRequest DEFAULT = new StreetSearchRequest ();
27+ public static final StreetSearchRequest DEFAULT = new StreetSearchRequest ();
2828
2929 /**
3030 * How close to do you have to be to the start or end to be considered "close".
@@ -80,7 +80,7 @@ private StreetSearchRequest() {
8080 this .rentalPeriod = null ;
8181 this .intersectionTraversalCalculator = IntersectionTraversalCalculator .DEFAULT ;
8282 this .extensionRequestContexts = List .of ();
83- this .timeout = Duration .ofSeconds (30 );
83+ this .timeout = Duration .ofSeconds (5 );
8484 }
8585
8686 StreetSearchRequest (StreetSearchRequestBuilder builder ) {
Original file line number Diff line number Diff line change 11package org .opentripplanner .street .search .request ;
22
3+ import static org .junit .jupiter .api .Assertions .assertEquals ;
34import static org .junit .jupiter .api .Assertions .assertFalse ;
45import static org .junit .jupiter .api .Assertions .assertTrue ;
56import static org .opentripplanner .street .search .TraverseMode .BICYCLE ;
67import static org .opentripplanner .street .search .TraverseMode .CAR ;
78import static org .opentripplanner .street .search .TraverseMode .SCOOTER ;
89
10+ import java .time .Duration ;
911import java .util .List ;
1012import org .junit .jupiter .api .Test ;
1113import org .opentripplanner .street .search .TraverseMode ;
@@ -26,4 +28,10 @@ void withUseRentalAvailability() {
2628 )
2729 );
2830 }
31+
32+ @ Test
33+ void defaultTimeout () {
34+ var orig = StreetSearchRequest .of ().build ();
35+ assertEquals (Duration .ofSeconds (5 ), orig .timeout ());
36+ }
2937}
You can’t perform that action at this time.
0 commit comments