mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Increasing timeout to be 10 minutes
Adjusting message
This commit is contained in:
@@ -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; } = "";
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user