Sets long timeouts for debug/repostore call.
This commit is contained in:
parent
1a277ef1b5
commit
8f37b4cf38
|
@ -23,6 +23,7 @@ namespace Core
|
||||||
public interface IHttpFactoryTool
|
public interface IHttpFactoryTool
|
||||||
{
|
{
|
||||||
IHttp CreateHttp(Address address, string baseUrl, Action<HttpClient> onClientCreated, string? logAlias = null);
|
IHttp CreateHttp(Address address, string baseUrl, Action<HttpClient> onClientCreated, string? logAlias = null);
|
||||||
|
IHttp CreateHttp(Address address, string baseUrl, Action<HttpClient> onClientCreated, ITimeSet timeSet, string? logAlias = null);
|
||||||
IHttp CreateHttp(Address address, string baseUrl, string? logAlias = null);
|
IHttp CreateHttp(Address address, string baseUrl, string? logAlias = null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +54,12 @@ namespace Core
|
||||||
|
|
||||||
public IHttp CreateHttp(Address address, string baseUrl, Action<HttpClient> onClientCreated, string? logAlias = null)
|
public IHttp CreateHttp(Address address, string baseUrl, Action<HttpClient> onClientCreated, string? logAlias = null)
|
||||||
{
|
{
|
||||||
return new Http(log, timeSet, address, baseUrl, onClientCreated, logAlias);
|
return CreateHttp(address, baseUrl, onClientCreated, timeSet, logAlias);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IHttp CreateHttp(Address address, string baseUrl, Action<HttpClient> onClientCreated, ITimeSet ts, string? logAlias = null)
|
||||||
|
{
|
||||||
|
return new Http(log, ts, address, baseUrl, onClientCreated, logAlias);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IHttp CreateHttp(Address address, string baseUrl, string? logAlias = null)
|
public IHttp CreateHttp(Address address, string baseUrl, string? logAlias = null)
|
||||||
|
|
|
@ -36,4 +36,32 @@
|
||||||
return TimeSpan.FromMinutes(30);
|
return TimeSpan.FromMinutes(30);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class LongTimeSet : ITimeSet
|
||||||
|
{
|
||||||
|
public TimeSpan HttpCallTimeout()
|
||||||
|
{
|
||||||
|
return TimeSpan.FromHours(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TimeSpan HttpCallRetryTime()
|
||||||
|
{
|
||||||
|
return TimeSpan.FromHours(5);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TimeSpan HttpCallRetryDelay()
|
||||||
|
{
|
||||||
|
return TimeSpan.FromSeconds(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TimeSpan WaitForK8sServiceDelay()
|
||||||
|
{
|
||||||
|
return TimeSpan.FromSeconds(10);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TimeSpan K8sOperationTimeout()
|
||||||
|
{
|
||||||
|
return TimeSpan.FromMinutes(15);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace CodexPlugin
|
||||||
|
|
||||||
public CodexDebugRepoStoreResponse[] GetDebugRepoStore()
|
public CodexDebugRepoStoreResponse[] GetDebugRepoStore()
|
||||||
{
|
{
|
||||||
return Http().HttpGetJson<CodexDebugRepoStoreResponse[]>("debug/repostore");
|
return LongHttp().HttpGetJson<CodexDebugRepoStoreResponse[]>("debug/repostore");
|
||||||
}
|
}
|
||||||
|
|
||||||
public CodexDebugThresholdBreaches GetDebugThresholdBreaches()
|
public CodexDebugThresholdBreaches GetDebugThresholdBreaches()
|
||||||
|
@ -101,6 +101,11 @@ namespace CodexPlugin
|
||||||
return tools.CreateHttp(Container.Address, baseUrl: "/api/codex/v1", CheckContainerCrashed, Container.Name);
|
return tools.CreateHttp(Container.Address, baseUrl: "/api/codex/v1", CheckContainerCrashed, Container.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private IHttp LongHttp()
|
||||||
|
{
|
||||||
|
return tools.CreateHttp(Container.Address, baseUrl: "/api/codex/v1", CheckContainerCrashed, new LongTimeSet(), Container.Name);
|
||||||
|
}
|
||||||
|
|
||||||
private void CheckContainerCrashed(HttpClient client)
|
private void CheckContainerCrashed(HttpClient client)
|
||||||
{
|
{
|
||||||
if (hasContainerCrashed) throw new Exception("Container has crashed.");
|
if (hasContainerCrashed) throw new Exception("Container has crashed.");
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
using Core;
|
|
||||||
|
|
||||||
namespace DistTestCore
|
|
||||||
{
|
|
||||||
public class LongTimeSet : ITimeSet
|
|
||||||
{
|
|
||||||
public TimeSpan HttpCallTimeout()
|
|
||||||
{
|
|
||||||
return TimeSpan.FromHours(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public TimeSpan HttpCallRetryTime()
|
|
||||||
{
|
|
||||||
return TimeSpan.FromHours(5);
|
|
||||||
}
|
|
||||||
|
|
||||||
public TimeSpan HttpCallRetryDelay()
|
|
||||||
{
|
|
||||||
return TimeSpan.FromSeconds(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public TimeSpan WaitForK8sServiceDelay()
|
|
||||||
{
|
|
||||||
return TimeSpan.FromSeconds(10);
|
|
||||||
}
|
|
||||||
|
|
||||||
public TimeSpan K8sOperationTimeout()
|
|
||||||
{
|
|
||||||
return TimeSpan.FromMinutes(15);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue