Skip to content

Commit

Permalink
Added missing AnyContexts on await calls
Browse files Browse the repository at this point in the history
  • Loading branch information
niemyjski committed Mar 21, 2024
1 parent 560be7b commit 75360df
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Foundatio.Extensions.Hosting/Jobs/HostedJobService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private async Task ExecuteAsync(CancellationToken stoppingToken)
{
await runner.RunAsync(stoppingToken).AnyContext();
#if NET8_0_OR_GREATER
await _stoppingCts.CancelAsync();
await _stoppingCts.CancelAsync().AnyContext();
#else
_stoppingCts.Cancel();
#endif
Expand All @@ -79,7 +79,7 @@ public async Task StopAsync(CancellationToken cancellationToken)
try
{
#if NET8_0_OR_GREATER
await _stoppingCts.CancelAsync();
await _stoppingCts.CancelAsync().AnyContext();
#else
_stoppingCts.Cancel();
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/Foundatio/Lock/DisposableLock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public async Task ReleaseAsync()
if (_logger.IsEnabled(LogLevel.Debug))
_logger.LogDebug("Releasing lock ({LockId}) {Resource} after {Duration:g}", LockId, Resource, _duration.Elapsed);

await _lockProvider.ReleaseAsync(Resource, LockId);
await _lockProvider.ReleaseAsync(Resource, LockId).AnyContext();
}
}
}
2 changes: 1 addition & 1 deletion src/Foundatio/Lock/DisposableLockCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public async Task ReleaseAsync()
if (_logger.IsEnabled(LogLevel.Debug))
_logger.LogDebug("Releasing {LockCount} locks {Resource} after {Duration:g}", _locks.Count, Resource, _duration.Elapsed);

await Task.WhenAll(_locks.Select(l => l.ReleaseAsync()));
await Task.WhenAll(_locks.Select(l => l.ReleaseAsync())).AnyContext();
}
}

Expand Down

0 comments on commit 75360df

Please sign in to comment.