Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(geo): Increase Geo timeout so that it runs successfully on a Pixel 3a XL #2177

Merged
merged 3 commits into from Dec 14, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -40,6 +40,7 @@
* performing various operations.
*/
public final class SynchronousGeo {
private static final int TIMEOUT = 20 * 1000;
private final GeoCategoryBehavior asyncDelegate;

private SynchronousGeo(GeoCategoryBehavior asyncDelegate) {
Expand Down Expand Up @@ -76,7 +77,7 @@ public static SynchronousGeo delegatingToAmplify() {
* @throws GeoException if maps are not configured.
*/
public Collection<MapStyle> getAvailableMaps() throws GeoException {
return Await.result(asyncDelegate::getAvailableMaps);
return Await.result(TIMEOUT, asyncDelegate::getAvailableMaps);
}

/**
Expand All @@ -86,7 +87,7 @@ public Collection<MapStyle> getAvailableMaps() throws GeoException {
* @throws GeoException if default map is not configured.
*/
public MapStyle getDefaultMap() throws GeoException {
return Await.result(asyncDelegate::getDefaultMap);
return Await.result(TIMEOUT, asyncDelegate::getDefaultMap);
}

/**
Expand All @@ -99,7 +100,7 @@ public MapStyle getDefaultMap() throws GeoException {
public MapStyleDescriptor getMapStyleDescriptor(
GetMapStyleDescriptorOptions options
) throws GeoException {
return Await.<MapStyleDescriptor, GeoException>result((onResult, onError) ->
return Await.<MapStyleDescriptor, GeoException>result(TIMEOUT, (onResult, onError) ->
asyncDelegate.getMapStyleDescriptor(options, onResult, onError));
}

Expand All @@ -115,7 +116,7 @@ public GeoSearchResult searchByText(
String query,
GeoSearchByTextOptions options
) throws GeoException {
return Await.<GeoSearchResult, GeoException>result((onResult, onError) ->
return Await.<GeoSearchResult, GeoException>result(TIMEOUT, (onResult, onError) ->
asyncDelegate.searchByText(query, options, onResult, onError));
}

Expand All @@ -131,7 +132,7 @@ public GeoSearchResult searchByCoordinates(
Coordinates coordinates,
GeoSearchByCoordinatesOptions options
) throws GeoException {
return Await.<GeoSearchResult, GeoException>result((onResult, onError) ->
return Await.<GeoSearchResult, GeoException>result(TIMEOUT, (onResult, onError) ->
asyncDelegate.searchByCoordinates(coordinates, options, onResult, onError));
}
}