Skip to content

Commit a9672a3

Browse files
committed
fix async issue with invalidating the token
1 parent 0073ab8 commit a9672a3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/CometD.NetCore.Salesforce/Resilience/ResilientForceClient.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ private IAsyncPolicy GetAuthenticationRetryPolicy()
428428
.Handle<ForceApiException>(x => x.Message.Contains("ErrorCode INVALID_SESSION_ID"))
429429
.RetryAsync(
430430
retryCount: _options.Retry,
431-
onRetry: (ex, count, context) =>
431+
onRetryAsync: async (ex, count, context) =>
432432
{
433433
var methodName = context[PolicyContextMethod] ?? "MethodNotSpecified";
434434

@@ -439,7 +439,8 @@ private IAsyncPolicy GetAuthenticationRetryPolicy()
439439
_options.Retry,
440440
context.PolicyKey,
441441
ex.Message);
442-
_forceClient.Invalidate();
442+
443+
await _forceClient.Invalidate();
443444
})
444445
.WithPolicyKey($"{nameof(ResilientForceClient)}RetryAsync");
445446
}

0 commit comments

Comments
 (0)