You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/SendGrid/Reliability/ReliabilitySettings.cs
+39-4Lines changed: 39 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -7,23 +7,58 @@ namespace SendGrid.Reliability
7
7
/// </summary>
8
8
publicclassReliabilitySettings
9
9
{
10
+
privateintretryCount;
11
+
privateTimeSpanretryInterval;
12
+
10
13
/// <summary>
11
14
/// Initializes a new instance of the <see cref="ReliabilitySettings"/> class.
12
15
/// </summary>
13
16
publicReliabilitySettings()
14
17
{
15
-
RetryCount=0;
16
-
RetryInterval=TimeSpan.FromSeconds(1);
18
+
retryCount=0;
19
+
retryInterval=TimeSpan.FromSeconds(1);
17
20
}
18
21
19
22
/// <summary>
20
23
/// Gets or sets the number of retries to execute against an HTTP service endpoint before throwing an exceptions. Defaults to 0 (no retries, you must explicitly enable)
21
24
/// </summary>
22
-
publicintRetryCount{get;set;}
25
+
publicintRetryCount
26
+
{
27
+
get
28
+
{
29
+
returnretryCount;
30
+
}
31
+
32
+
set
33
+
{
34
+
if(value<0)
35
+
{
36
+
thrownewArgumentException("Retry count must be greater than zero");
37
+
}
38
+
39
+
retryCount=value;
40
+
}
41
+
}
23
42
24
43
/// <summary>
25
44
/// Gets or sets the interval between HTTP retries. Defaults to 1 second
26
45
/// </summary>
27
-
publicTimeSpanRetryInterval{get;set;}
46
+
publicTimeSpanRetryInterval
47
+
{
48
+
get
49
+
{
50
+
returnretryInterval;
51
+
}
52
+
53
+
set
54
+
{
55
+
if(value.TotalSeconds>30)
56
+
{
57
+
thrownewArgumentException("Maximum retry interval is 30 seconds");
0 commit comments