Skip to content

Commit 00db058

Browse files
author
Oren Novotny
committed
Timeout to infinite
1 parent 6fc338e commit 00db058

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/SignClient/ISignService.cs

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ public interface ISignService
1111
[Multipart]
1212
[Post("/sign?hashMode={hashMode}&name={name}&description={description}&descriptionUrl={descriptionUrl}")]
1313
Task<HttpResponseMessage> SignFile(FileInfo source, FileInfo filelist, HashMode hashMode, string name, string description, string descriptionUrl);
14+
15+
HttpClient Client { get; }
1416
}
1517

1618
public enum HashMode

src/SignClient/SignCommand.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Net;
55
using System.Net.Http;
66
using System.Security.Authentication;
7+
using System.Threading;
78
using System.Threading.Tasks;
89
using Microsoft.Extensions.CommandLineUtils;
910
using Microsoft.Extensions.Configuration;
@@ -91,11 +92,11 @@ CommandOption descriptionUrl
9192
var pca = PublicClientApplicationBuilder.Create(clientId)
9293
.WithAuthority(authority)
9394
.Build();
94-
95+
9596
var secret = new NetworkCredential("", clientSecret.Value()).SecurePassword;
9697

9798
var tokenResult = await pca.AcquireTokenByUsernamePassword(new[] { $"{resourceId}/user_impersonation" }, username.Value(), secret).ExecuteAsync();
98-
99+
99100
return tokenResult.AccessToken;
100101
}
101102
else
@@ -111,7 +112,9 @@ CommandOption descriptionUrl
111112
}
112113
};
113114

115+
114116
var client = RestService.For<ISignService>(configuration["SignClient:Service:Url"], settings);
117+
client.Client.Timeout = Timeout.InfiniteTimeSpan;
115118

116119
// Prepare input/output file
117120
var input = new FileInfo(ExpandFilePath(inputFile.Value()));

0 commit comments

Comments
 (0)