Skip to content

Commit df23617

Browse files
committed
fixup! Rework CredentialManager
1 parent 1089677 commit df23617

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

App/Services/CredentialManager.cs

+6
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,14 @@ private async Task<CredentialModel> LoadCredentialsInner(CancellationToken ct)
220220
// we just return that instead.
221221
using (await _opLock.LockAsync(ct))
222222
{
223+
ct.ThrowIfCancellationRequested();
224+
225+
// _latestCredentials will be set if we were preempted.
223226
var latestCreds = _latestCredentials;
224227
if (latestCreds != null) return latestCreds;
228+
229+
// Prevent new LoadCredentials calls from returning this task since
230+
// it's pretty much done.
225231
if (_loadCts != null)
226232
{
227233
_loadCts.Dispose();

0 commit comments

Comments
 (0)