Skip to content

Commit

Permalink
Update lastRegistered initialization and stop method in PipeliningHos…
Browse files Browse the repository at this point in the history
…tedService

- Initialize _lastRegistered as an empty array instead of a list
- Modify the StopAsync method to assign an empty array to _lastRegistered
- Add import for PackSite.Library.Exceptions.props in PackSite.Libraries.props
  • Loading branch information
adambajguz committed Apr 15, 2024
1 parent db5ee51 commit ae7d372
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Expand Up @@ -19,7 +19,7 @@ internal sealed class PipeliningConfigurationHostedService(
IPipelineCollection pipelineCollection,
ILoggerFactory loggerFactory) : IHostedService, IDisposable
{
private IReadOnlyList<PipelineName> _lastRegistered = new List<PipelineName>();
private IReadOnlyList<PipelineName> _lastRegistered = [];
private IDisposable? _optionsMonitor;

private readonly SemaphoreSlim _lock = new(1, 1);
Expand All @@ -44,7 +44,7 @@ public async Task StartAsync(CancellationToken cancellationToken)
/// <inheritdoc/>
public Task StopAsync(CancellationToken cancellationToken)
{
_lastRegistered = new List<PipelineName>();
_lastRegistered = [];

return Task.CompletedTask;
}
Expand Down
1 change: 1 addition & 0 deletions src/props/PackSite.Libraries.props
Expand Up @@ -6,6 +6,7 @@
<Import Project="PackSite.Library.Crypto.props" Condition="Exists('PackSite.Library.Crypto.props')" />
<Import Project="PackSite.Library.DependencyInjection.props" Condition="Exists('PackSite.Library.DependencyInjection.props')" />
<Import Project="PackSite.Library.ETags.props" Condition="Exists('PackSite.Library.ETags.props')" />
<Import Project="PackSite.Library.Exceptions.props" Condition="Exists('PackSite.Library.Exceptions.props')" />
<Import Project="PackSite.Library.Extensions.props" Condition="Exists('PackSite.Library.Extensions.props')" />
<Import Project="PackSite.Library.Licensing.props" Condition="Exists('PackSite.Library.Licensing.props')" />
<Import Project="PackSite.Library.Logging.props" Condition="Exists('PackSite.Library.Logging.props')" />
Expand Down

0 comments on commit ae7d372

Please sign in to comment.