Skip to content

Commit

Permalink
feat(generators): allow per-spec timeouts [skip-bc] (#4173) (generate…
Browse files Browse the repository at this point in the history
…d) [skip ci]

Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
Co-authored-by: Pierre Millot <pierre.millot@algolia.com>
Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
  • Loading branch information
4 people committed Dec 5, 2024
1 parent 106d643 commit a14702d
Show file tree
Hide file tree
Showing 210 changed files with 1,282 additions and 3,574 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public AbtestingConfig(string appId, string apiKey, string region = null) : base
{
DefaultHosts = GetDefaultHosts(region);
Compression = CompressionType.None;
ReadTimeout = TimeSpan.FromSeconds(5);
WriteTimeout = TimeSpan.FromSeconds(30);
ConnectTimeout = TimeSpan.FromSeconds(2);
}
private static List<StatefulHost> GetDefaultHosts(string region)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public AnalyticsConfig(string appId, string apiKey, string region = null) : base
{
DefaultHosts = GetDefaultHosts(region);
Compression = CompressionType.None;
ReadTimeout = TimeSpan.FromSeconds(5);
WriteTimeout = TimeSpan.FromSeconds(30);
ConnectTimeout = TimeSpan.FromSeconds(2);
}
private static List<StatefulHost> GetDefaultHosts(string region)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public IngestionConfig(string appId, string apiKey, string region) : base(appId,
{
DefaultHosts = GetDefaultHosts(region);
Compression = CompressionType.None;
ReadTimeout = TimeSpan.FromSeconds(25);
WriteTimeout = TimeSpan.FromSeconds(25);
ConnectTimeout = TimeSpan.FromSeconds(25);
}
private static List<StatefulHost> GetDefaultHosts(string region)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public InsightsConfig(string appId, string apiKey, string region = null) : base(
{
DefaultHosts = GetDefaultHosts(region);
Compression = CompressionType.None;
ReadTimeout = TimeSpan.FromSeconds(5);
WriteTimeout = TimeSpan.FromSeconds(30);
ConnectTimeout = TimeSpan.FromSeconds(2);
}
private static List<StatefulHost> GetDefaultHosts(string region)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public MonitoringConfig(string appId, string apiKey) : base(appId, apiKey, "Moni
{
DefaultHosts = GetDefaultHosts();
Compression = CompressionType.None;
ReadTimeout = TimeSpan.FromSeconds(5);
WriteTimeout = TimeSpan.FromSeconds(30);
ConnectTimeout = TimeSpan.FromSeconds(2);
}
private static List<StatefulHost> GetDefaultHosts()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public PersonalizationConfig(string appId, string apiKey, string region) : base(
{
DefaultHosts = GetDefaultHosts(region);
Compression = CompressionType.None;
ReadTimeout = TimeSpan.FromSeconds(5);
WriteTimeout = TimeSpan.FromSeconds(30);
ConnectTimeout = TimeSpan.FromSeconds(2);
}
private static List<StatefulHost> GetDefaultHosts(string region)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public QuerySuggestionsConfig(string appId, string apiKey, string region) : base
{
DefaultHosts = GetDefaultHosts(region);
Compression = CompressionType.None;
ReadTimeout = TimeSpan.FromSeconds(5);
WriteTimeout = TimeSpan.FromSeconds(30);
ConnectTimeout = TimeSpan.FromSeconds(2);
}
private static List<StatefulHost> GetDefaultHosts(string region)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public RecommendConfig(string appId, string apiKey) : base(appId, apiKey, "Recom
{
DefaultHosts = GetDefaultHosts(appId);
Compression = CompressionType.None;
ReadTimeout = TimeSpan.FromSeconds(5);
WriteTimeout = TimeSpan.FromSeconds(30);
ConnectTimeout = TimeSpan.FromSeconds(2);
}
private static List<StatefulHost> GetDefaultHosts(string appId)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public SearchConfig(string appId, string apiKey) : base(appId, apiKey, "Search",
{
DefaultHosts = GetDefaultHosts(appId);
Compression = CompressionType.None;
ReadTimeout = TimeSpan.FromSeconds(5);
WriteTimeout = TimeSpan.FromSeconds(30);
ConnectTimeout = TimeSpan.FromSeconds(2);
}
private static List<StatefulHost> GetDefaultHosts(string appId)
{
Expand Down
10 changes: 10 additions & 0 deletions clients/algoliasearch-client-go/algolia/abtesting/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions clients/algoliasearch-client-go/algolia/analytics/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions clients/algoliasearch-client-go/algolia/ingestion/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions clients/algoliasearch-client-go/algolia/insights/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions clients/algoliasearch-client-go/algolia/monitoring/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions clients/algoliasearch-client-go/algolia/personalization/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions clients/algoliasearch-client-go/algolia/recommend/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions clients/algoliasearch-client-go/algolia/search/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.algolia.model.abtesting.*;
import com.algolia.utils.*;
import com.fasterxml.jackson.core.type.TypeReference;
import java.time.Duration;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
Expand All @@ -34,7 +35,16 @@ public AbtestingClient(String appId, String apiKey, String region) {
}

public AbtestingClient(String appId, String apiKey, String region, ClientOptions options) {
super(appId, apiKey, "Abtesting", options, getDefaultHosts(region));
super(
appId,
apiKey,
"Abtesting",
options,
getDefaultHosts(region),
Duration.ofMillis(2000L),
Duration.ofMillis(5000L),
Duration.ofMillis(30000L)
);
}

private static List<Host> getDefaultHosts(String region) throws AlgoliaRuntimeException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.algolia.model.analytics.*;
import com.algolia.utils.*;
import com.fasterxml.jackson.core.type.TypeReference;
import java.time.Duration;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
Expand All @@ -34,7 +35,16 @@ public AnalyticsClient(String appId, String apiKey, String region) {
}

public AnalyticsClient(String appId, String apiKey, String region, ClientOptions options) {
super(appId, apiKey, "Analytics", options, getDefaultHosts(region));
super(
appId,
apiKey,
"Analytics",
options,
getDefaultHosts(region),
Duration.ofMillis(2000L),
Duration.ofMillis(5000L),
Duration.ofMillis(30000L)
);
}

private static List<Host> getDefaultHosts(String region) throws AlgoliaRuntimeException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.algolia.model.ingestion.*;
import com.algolia.utils.*;
import com.fasterxml.jackson.core.type.TypeReference;
import java.time.Duration;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
Expand All @@ -26,7 +27,16 @@ public IngestionClient(String appId, String apiKey, String region) {
}

public IngestionClient(String appId, String apiKey, String region, ClientOptions options) {
super(appId, apiKey, "Ingestion", options, getDefaultHosts(region));
super(
appId,
apiKey,
"Ingestion",
options,
getDefaultHosts(region),
Duration.ofMillis(25000L),
Duration.ofMillis(25000L),
Duration.ofMillis(25000L)
);
}

private static List<Host> getDefaultHosts(String region) throws AlgoliaRuntimeException {
Expand Down
Loading

0 comments on commit a14702d

Please sign in to comment.