2
0
mirror of synced 2025-01-12 17:44:08 +00:00

68 lines
1.4 KiB
C#
Raw Normal View History

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