walk back some timeout changes

This commit is contained in:
Caelan Sayler
2024-12-27 11:04:49 +00:00
committed by Caelan
parent 0e9757d1b7
commit c312b6552b
5 changed files with 9 additions and 5 deletions

View File

@@ -24,7 +24,12 @@ public class PublishTask : MSBuildAsyncTask
protected override async Task<bool> ExecuteAsync(CancellationToken cancellationToken)
{
TimeSpan timeout = Timeout == null ? TimeSpan.FromMinutes(30) : TimeSpan.Parse(Timeout);
double timeout;
if (double.TryParse(Timeout, out var parsedTimeout)) {
timeout = parsedTimeout;
} else {
timeout = 30d;
}
//System.Diagnostics.Debugger.Launch();
var options = new VelopackFlowServiceOptions {

View File

@@ -23,7 +23,7 @@
<VelopackPackAuthors Condition="'$(VelopackPackAuthors)' == ''">$(Authors)</VelopackPackAuthors>
<VelopackTargetRuntime Condition="'$(VelopackTargetRuntime)' == ''">$(RuntimeIdentifier)</VelopackTargetRuntime>
<VelopackShortcuts Condition="'$(VelopackShortcuts)' == ''">Desktop,StartMenuRoot</VelopackShortcuts>
<VelopackHttpTimeout Condition="'$(VelopackHttpTimeout)' == ''">00:30:00</VelopackHttpTimeout>
<VelopackHttpTimeout Condition="'$(VelopackHttpTimeout)' == ''">30</VelopackHttpTimeout>
<VelopackWaitForLive Condition="'$(VelopackWaitForLive)' == ''">false</VelopackWaitForLive>
<!-- Allows a cross platform app (eg. Avalonia) to specify all three via csproj and have them applied correctly -->

View File

@@ -54,7 +54,7 @@ public class VelopackFlowServiceClient(
var client = new HttpClient(handler);
client.DefaultRequestHeaders.Authorization = Authorization;
client.Timeout = Options.Timeout;
client.Timeout = TimeSpan.FromMinutes(Options.Timeout);
return client;
}

View File

@@ -6,5 +6,5 @@ public class VelopackFlowServiceOptions
public string? ApiKey { get; set; } = string.Empty;
public TimeSpan Timeout { get; set; } = TimeSpan.FromMinutes(30);
public double Timeout { get; set; } = 30d;
}

View File

@@ -53,7 +53,6 @@ public static partial class OptionMapper
public static partial DeltaPatchOptions ToOptions(this DeltaPatchCommand cmd);
[MapperIgnoreTarget(nameof(LocalDownloadOptions.Timeout))]
public static partial LoginOptions ToOptions(this LoginCommand cmd);
public static partial LogoutOptions ToOptions(this LogoutCommand cmd);