Skip to content

Commit

Permalink
Fixed install issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bergmania committed Sep 4, 2024
1 parent a2c30d9 commit dcd6f1f
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,27 @@ namespace Umbraco.Cms.Core.Services.Navigation;
/// </summary>
public sealed class NavigationInitializationHostedService : IHostedLifecycleService
{
private readonly IRuntimeState _runtimeState;
private readonly IDocumentNavigationManagementService _documentNavigationManagementService;
private readonly IMediaNavigationManagementService _mediaNavigationManagementService;

public NavigationInitializationHostedService(IDocumentNavigationManagementService documentNavigationManagementService, IMediaNavigationManagementService mediaNavigationManagementService)
public NavigationInitializationHostedService(
IRuntimeState runtimeState,
IDocumentNavigationManagementService documentNavigationManagementService,
IMediaNavigationManagementService mediaNavigationManagementService)
{
_runtimeState = runtimeState;
_documentNavigationManagementService = documentNavigationManagementService;
_mediaNavigationManagementService = mediaNavigationManagementService;
}

public async Task StartingAsync(CancellationToken cancellationToken)
{
if(_runtimeState.Level < RuntimeLevel.Upgrade)
{
return;
}

await _documentNavigationManagementService.RebuildAsync();
await _documentNavigationManagementService.RebuildBinAsync();
await _mediaNavigationManagementService.RebuildAsync();
Expand Down

0 comments on commit dcd6f1f

Please sign in to comment.