File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/Common/Commands.Common.Authentication/Factories Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 13
13
// ----------------------------------------------------------------------------------
14
14
15
15
using System ;
16
+ using System . Linq ;
16
17
using System . Net . Http ;
17
18
using System . Threading ;
18
19
using System . Threading . Tasks ;
@@ -26,7 +27,8 @@ namespace Microsoft.Azure.Commands.Common.Authentication.Factories
26
27
/// </summary>
27
28
public class CancelRetryHandler : DelegatingHandler , ICloneable
28
29
{
29
- const string TestModeVariableKey = "Azure_Test_Mode" , TestModeVariableValue = "Record" ;
30
+ static readonly string [ ] TestModeLiveValues = { "Record" , "None" , "Live" } ;
31
+ const string TestModeVariableKey = "Azure_Test_Mode" ;
30
32
public CancelRetryHandler ( )
31
33
{
32
34
WaitInterval = TimeSpan . Zero ;
@@ -64,7 +66,7 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
64
66
void SleepIfRunningLive ( TimeSpan timeSpan )
65
67
{
66
68
var testModeSetting = Environment . GetEnvironmentVariable ( TestModeVariableKey ) ;
67
- if ( string . IsNullOrWhiteSpace ( testModeSetting ) || ! string . Equals ( TestModeVariableValue , testModeSetting , StringComparison . OrdinalIgnoreCase ) )
69
+ if ( string . IsNullOrWhiteSpace ( testModeSetting ) || TestModeLiveValues . Any ( v => string . Equals ( v , testModeSetting , StringComparison . OrdinalIgnoreCase ) ) )
68
70
{
69
71
Thread . Sleep ( timeSpan ) ;
70
72
}
You can’t perform that action at this time.
0 commit comments