Increasing timeout to be 10 minutes

Adjusting message
This commit is contained in:
Kevin Bost
2024-05-20 23:10:00 -07:00
parent 558d6b35a9
commit 49d6864649
3 changed files with 10 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
using System.Net.Http;
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Extensions.Logging;
@@ -8,7 +9,9 @@ namespace Velopack.Build;
public class PublishTask : MSBuildAsyncTask
{
private static HttpClient HttpClient { get; } = new(new HmacAuthHttpClientHandler());
private static HttpClient HttpClient { get; } = new(new HmacAuthHttpClientHandler()) {
Timeout = TimeSpan.FromMinutes(10)
};
[Required]
public string ReleaseDirectory { get; set; } = "";

View File

@@ -119,7 +119,7 @@ public class VelopackFlowServiceClient(HttpClient HttpClient, ILogger Logger) :
}
}
Logger.LogInformation("Preparing to upload {AssetCount} assets to Velopack ({ServiceUrl})", latestAssets.Count + installers.Count, serviceUrl);
Logger.LogInformation("Uploading {AssetCount} assets to Velopack ({ServiceUrl})", latestAssets.Count + installers.Count, serviceUrl);
foreach (var assetFileName in files) {
@@ -301,7 +301,9 @@ public class VelopackFlowServiceClient(HttpClient HttpClient, ILogger Logger) :
.Create(authConfiguration.ClientId)
.WithB2CAuthority(authConfiguration.B2CAuthority)
.WithRedirectUri(authConfiguration.RedirectUri)
//.WithLogging((LogLevel level, string message, bool containsPii) => System.Console.WriteLine($"[{level}]: {message}"))
#if DEBUG
.WithLogging((Microsoft.Identity.Client.LogLevel level, string message, bool containsPii) => System.Console.WriteLine($"[{level}]: {message}"), enablePiiLogging: true, enableDefaultPlatformLogging: true)
#endif
.WithClientName("velopack")
.Build();

View File

@@ -149,7 +149,7 @@ public class Program
{
services.AddSingleton<IVelopackFlowServiceClient, VelopackFlowServiceClient>();
services.AddSingleton<HmacAuthHttpClientHandler>();
services.AddHttpClient().ConfigureHttpClientDefaults(x => x.AddHttpMessageHandler<HmacAuthHttpClientHandler>());
services.AddHttpClient().ConfigureHttpClientDefaults(x => x.AddHttpMessageHandler<HmacAuthHttpClientHandler>().ConfigureHttpClient(httpClient => httpClient.Timeout = TimeSpan.FromMinutes(10)));
}
}