2023-09-12 11:32:06 +00:00
|
|
|
|
namespace Core
|
2023-04-12 14:06:04 +00:00
|
|
|
|
{
|
|
|
|
|
public interface ITimeSet
|
|
|
|
|
{
|
|
|
|
|
TimeSpan HttpCallTimeout();
|
2023-10-23 08:11:02 +00:00
|
|
|
|
int HttpMaxNumberOfRetries();
|
2023-05-10 07:55:36 +00:00
|
|
|
|
TimeSpan HttpCallRetryDelay();
|
2023-04-12 14:06:04 +00:00
|
|
|
|
TimeSpan WaitForK8sServiceDelay();
|
|
|
|
|
TimeSpan K8sOperationTimeout();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class DefaultTimeSet : ITimeSet
|
|
|
|
|
{
|
|
|
|
|
public TimeSpan HttpCallTimeout()
|
|
|
|
|
{
|
2023-10-23 08:11:02 +00:00
|
|
|
|
return TimeSpan.FromMinutes(3);
|
2023-04-12 14:06:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-10-23 08:11:02 +00:00
|
|
|
|
public int HttpMaxNumberOfRetries()
|
2023-04-12 14:06:04 +00:00
|
|
|
|
{
|
2023-10-23 08:11:02 +00:00
|
|
|
|
return 3;
|
2023-04-12 14:06:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-05-10 07:55:36 +00:00
|
|
|
|
public TimeSpan HttpCallRetryDelay()
|
2023-04-12 14:06:04 +00:00
|
|
|
|
{
|
2023-06-08 11:23:26 +00:00
|
|
|
|
return TimeSpan.FromSeconds(1);
|
2023-04-12 14:06:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TimeSpan WaitForK8sServiceDelay()
|
|
|
|
|
{
|
2023-08-16 08:52:44 +00:00
|
|
|
|
return TimeSpan.FromSeconds(10);
|
2023-04-12 14:06:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TimeSpan K8sOperationTimeout()
|
|
|
|
|
{
|
2023-08-16 08:52:44 +00:00
|
|
|
|
return TimeSpan.FromMinutes(30);
|
2023-04-12 14:06:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-10-10 16:08:21 +00:00
|
|
|
|
|
|
|
|
|
public class LongTimeSet : ITimeSet
|
|
|
|
|
{
|
|
|
|
|
public TimeSpan HttpCallTimeout()
|
|
|
|
|
{
|
|
|
|
|
return TimeSpan.FromHours(2);
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-23 08:11:02 +00:00
|
|
|
|
public int HttpMaxNumberOfRetries()
|
2023-10-10 16:08:21 +00:00
|
|
|
|
{
|
2023-10-23 08:11:02 +00:00
|
|
|
|
return 1;
|
2023-10-10 16:08:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TimeSpan HttpCallRetryDelay()
|
|
|
|
|
{
|
|
|
|
|
return TimeSpan.FromSeconds(2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TimeSpan WaitForK8sServiceDelay()
|
|
|
|
|
{
|
|
|
|
|
return TimeSpan.FromSeconds(10);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TimeSpan K8sOperationTimeout()
|
|
|
|
|
{
|
|
|
|
|
return TimeSpan.FromMinutes(15);
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-04-12 14:06:04 +00:00
|
|
|
|
}
|