From 4a44144b397a1d776cabc1f7894309cf4e2cacd2 Mon Sep 17 00:00:00 2001 From: Ilya Murashko Date: Sun, 8 Jan 2023 19:36:01 +0300 Subject: [PATCH] Pass missed CancellationTokens from API to IApiClientTransport calls --- .../AqlFunctionApi/AqlFunctionApiClient.cs | 32 +++++++++---------- .../ViewApi/ViewsApiClient.cs | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/arangodb-net-standard/AqlFunctionApi/AqlFunctionApiClient.cs b/arangodb-net-standard/AqlFunctionApi/AqlFunctionApiClient.cs index 0d485daa..0ec57180 100644 --- a/arangodb-net-standard/AqlFunctionApi/AqlFunctionApiClient.cs +++ b/arangodb-net-standard/AqlFunctionApi/AqlFunctionApiClient.cs @@ -61,7 +61,7 @@ public virtual async Task PostAqlFunctionAsync( { var content = GetContent(body, new ApiClientSerializationOptions(true, true)); - using (var response = await _transport.PostAsync(_apiPath, content).ConfigureAwait(false)) + using (var response = await _transport.PostAsync(_apiPath, content, token: token).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -92,7 +92,7 @@ public virtual async Task DeleteAqlFunctionAsync( uri += "?" + query.ToQueryString(); } - using (var response = await _transport.DeleteAsync(uri).ConfigureAwait(false)) + using (var response = await _transport.DeleteAsync(uri, token: token).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -120,7 +120,7 @@ public virtual async Task GetAqlFunctionsAsync( uri += "?" + query.ToQueryString(); } - using (var response = await _transport.GetAsync(uri).ConfigureAwait(false)) + using (var response = await _transport.GetAsync(uri, token: token).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -150,7 +150,7 @@ public virtual async Task PostExplainAqlQueryAsync( string uri = "_api/explain"; var content = GetContent(body, new ApiClientSerializationOptions(true, true)); - using (var response = await _transport.PostAsync(uri, content).ConfigureAwait(false)) + using (var response = await _transport.PostAsync(uri, content, token: token).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -180,7 +180,7 @@ public virtual async Task PostParseAqlQueryAsync( string uri = "_api/query"; var content = GetContent(body, new ApiClientSerializationOptions(true, true)); - using (var response = await _transport.PostAsync(uri, content).ConfigureAwait(false)) + using (var response = await _transport.PostAsync(uri, content, token: token).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -227,7 +227,7 @@ public virtual async Task DeleteKillRunningAqlQueryAsync( uri += "?" + query.ToQueryString(); } - using (var response = await _transport.DeleteAsync(uri).ConfigureAwait(false)) + using (var response = await _transport.DeleteAsync(uri, token: token).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -262,7 +262,7 @@ public virtual async Task DeleteClearSlowAqlQueriesAsync( uri += "?" + query.ToQueryString(); } - using (var response = await _transport.DeleteAsync(uri).ConfigureAwait(false)) + using (var response = await _transport.DeleteAsync(uri, token: token).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -305,7 +305,7 @@ public virtual async Task> GetSlowAqlQueriesAsync( uri += "?" + query.ToQueryString(); } - using (var response = await _transport.GetAsync(uri).ConfigureAwait(false)) + using (var response = await _transport.GetAsync(uri, token: token).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -329,7 +329,7 @@ public virtual async Task DeleteClearAqlQueryCacheAsync( { string uri = "_api/query-cache"; - using (var response = await _transport.DeleteAsync(uri).ConfigureAwait(false)) + using (var response = await _transport.DeleteAsync(uri, token: token).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -354,7 +354,7 @@ public virtual async Task> GetCachedAqlQueryResultsAs CancellationToken token = default) { string uri = "_api/query-cache/entries"; - using (var response = await _transport.GetAsync(uri).ConfigureAwait(false)) + using (var response = await _transport.GetAsync(uri, token: token).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -377,7 +377,7 @@ public virtual async Task GetQueryCacheGlobalPropert CancellationToken token = default) { string uri = "_api/query-cache/properties"; - using (var response = await _transport.GetAsync(uri).ConfigureAwait(false)) + using (var response = await _transport.GetAsync(uri, token: token).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -412,7 +412,7 @@ public virtual async Task PutAdjustQueryCacheGlobalP string uri = "_api/query-cache/properties"; var content = GetContent(body, new ApiClientSerializationOptions(true, true)); - using (var response = await _transport.PutAsync(uri, content).ConfigureAwait(false)) + using (var response = await _transport.PutAsync(uri, content, token: token).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -433,7 +433,7 @@ public virtual async Task GetQueryTrackingConfigurat CancellationToken token = default) { string uri = "_api/query/properties"; - using (var response = await _transport.GetAsync(uri).ConfigureAwait(false)) + using (var response = await _transport.GetAsync(uri, token: token).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -467,7 +467,7 @@ public virtual async Task PutChangeQueryTrackingConf string uri = "_api/query/properties"; var content = GetContent(body, new ApiClientSerializationOptions(true, true)); - using (var response = await _transport.PutAsync(uri, content).ConfigureAwait(false)) + using (var response = await _transport.PutAsync(uri, content, token: token).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -498,7 +498,7 @@ public virtual async Task> GetCurrentlyRunningAqlQueriesAs uri += "?" + query.ToQueryString(); } - using (var response = await _transport.GetAsync(uri).ConfigureAwait(false)) + using (var response = await _transport.GetAsync(uri, token: token).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -523,7 +523,7 @@ public virtual async Task> GetQueryRulesAsync(CancellationTok { string uri = "_api/query/rules"; - using (var response = await _transport.GetAsync(uri).ConfigureAwait(false)) + using (var response = await _transport.GetAsync(uri, token: token).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { diff --git a/arangodb-net-standard/ViewApi/ViewsApiClient.cs b/arangodb-net-standard/ViewApi/ViewsApiClient.cs index d605c5c0..97d66670 100644 --- a/arangodb-net-standard/ViewApi/ViewsApiClient.cs +++ b/arangodb-net-standard/ViewApi/ViewsApiClient.cs @@ -88,7 +88,7 @@ public virtual async Task PostCreateViewAsync(ViewDetails body, bo useCamelCasePropertyNames: true, ignoreNullValues: ignoreNullValuesOnSerialization, applySerializationOptionsToDictionaryValues: true)); - using (var response = await _transport.PostAsync(uri, content).ConfigureAwait(false)) + using (var response = await _transport.PostAsync(uri, content, token: token).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) {