mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-05-29 17:32:44 +00:00
specify the timeout interval when downloading the archive
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Octokit
|
||||
@@ -166,7 +167,7 @@ namespace Octokit
|
||||
|
||||
var endpoint = ApiUrls.RepositoryArchiveLink(owner, name, archiveFormat, reference);
|
||||
|
||||
var response = await Connection.Get<byte[]>(endpoint, new Dictionary<string, string>(), null);
|
||||
var response = await Connection.Get<byte[]>(endpoint, TimeSpan.FromMinutes(60));
|
||||
|
||||
return response.Body;
|
||||
}
|
||||
|
||||
@@ -168,6 +168,13 @@ namespace Octokit
|
||||
return SendData<T>(uri.ApplyParameters(parameters), HttpMethod.Get, null, accepts, null, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<IApiResponse<T>> Get<T>(Uri uri, TimeSpan timeout)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
|
||||
return SendData<T>(uri, HttpMethod.Get, null, null, null, timeout, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs an asynchronous HTTP GET request that expects a <seealso cref="IResponse"/> containing HTML.
|
||||
/// </summary>
|
||||
|
||||
@@ -58,6 +58,17 @@ namespace Octokit
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
|
||||
Task<IApiResponse<T>> Get<T>(Uri uri, IDictionary<string, string> parameters, string accepts, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Performs an asynchronous HTTP GET request.
|
||||
/// Attempts to map the response to an object of type <typeparamref name="T"/>
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type to map the response to</typeparam>
|
||||
/// <param name="uri">URI endpoint to send request to</param>
|
||||
/// <param name="timeout">Expiration time of the request</param>
|
||||
/// <returns><seealso cref="IResponse"/> representing the received HTTP response</returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
|
||||
Task<IApiResponse<T>> Get<T>(Uri uri, TimeSpan timeout);
|
||||
|
||||
/// <summary>
|
||||
/// Performs an asynchronous HTTP PATCH request.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user