in src/Amazon.SecretsManager.Extensions.Caching/SecretCacheObject.cs [212:230]
public async Task<GetSecretValueResponse> GetSecretValue(CancellationToken cancellationToken)
{
bool success = false;
await Lock.WaitAsync(cancellationToken);
try
{
success = await RefreshAsync(cancellationToken);
}
finally
{
Lock.Release();
}
if (!success && null == data && null != exception)
{
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Capture(exception).Throw();
}
return await GetSecretValueAsync(GetResult(), cancellationToken);
}