-
Notifications
You must be signed in to change notification settings - Fork 322
Azure Split - Step 4 - Cleanup #3917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
8dcc62d
9f7a47a
9a275d3
719dba6
16e6d6f
b211270
faecd74
26031e4
029f54d
a01354c
d4fb1cb
11465b5
203bef0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,7 @@ steps: | |
| msBuildCommandline: >- | ||
| msbuild | ||
| ${{parameters.sourceRoot}}\build.proj | ||
| -t:BuildAllConfigurations | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Best to be explicit in case we change the default target. |
||
| -p:configuration=Release | ||
| -p:GenerateNuget=false | ||
| -p:BuildTools=false | ||
| -p:SigningKeyPath=$(Agent.TempDirectory)\netfxKeypair.snk | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -273,10 +273,10 @@ jobs: | |
|
|
||
| # List the DLLs in the output directory for debugging purposes. | ||
| - ${{ if eq(parameters.debug, true) }}: | ||
| - pwsh: > | ||
| - pwsh: >- | ||
| Get-ChildItem | ||
| -Path "src/Microsoft.Data.SqlClient.Extensions/Azure/test/bin/${{ parameters.buildConfiguration }}" | ||
| -Recurse | ||
| -Path "src/Microsoft.Data.SqlClient.Extensions/Azure/test/bin/${{ parameters.buildConfiguration }}" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lines with different leading whitespace than the previous line aren't folded together! |
||
| -Recurse | ||
| displayName: '[Debug] List Output DLLs' | ||
|
|
||
| # Run the tests for each .NET runtime. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -358,20 +358,36 @@ previousPw is byte[] previousPwBytes && | |
| if (ex is MsalServiceException svcEx && | ||
| svcEx.StatusCode == MsalRetryStatusCode) | ||
| { | ||
| int retryPeriod = 0; | ||
|
|
||
| var retryAfter = svcEx.Headers.RetryAfter; | ||
| if (retryAfter is not null) | ||
| { | ||
| // Prefer the Delta value over Date. | ||
| double totalMilliseconds = 0; | ||
|
|
||
| if (retryAfter.Delta.HasValue) | ||
| { | ||
| retryPeriod = retryAfter.Delta.Value.Milliseconds; | ||
| totalMilliseconds = retryAfter.Delta.Value.TotalMilliseconds; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoops - the old code was using just the milliseconds portion of the delta. |
||
| } | ||
| else if (retryAfter.Date.HasValue) | ||
| { | ||
| retryPeriod = Convert.ToInt32(retryAfter.Date.Value.Offset.TotalMilliseconds); | ||
| var now = DateTimeOffset.UtcNow; | ||
| if (retryAfter.Date.Value > now) | ||
| { | ||
| totalMilliseconds = (retryAfter.Date.Value - now).TotalMilliseconds; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The old code was using the timezone offset , not the difference between the Date and now. |
||
| } | ||
| } | ||
|
|
||
| int retryPeriod = | ||
| // Ignore nonsensical values. | ||
| totalMilliseconds <= 0 | ||
| ? 0 | ||
| // Avoid overflow when converting to an int. | ||
| : totalMilliseconds > int.MaxValue | ||
| ? int.MaxValue | ||
| // Convert from double to int safely. | ||
| : Convert.ToInt32(totalMilliseconds); | ||
|
|
||
| // Report the retryable error. | ||
| throw new Extensions.Azure.AuthenticationException( | ||
| parameters.AuthenticationMethod, | ||
| ex.ErrorCode, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.