-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initialize important services before unattended installs (#17366)
* Added new notification to hook in after the premigrations and use this to init different services. * Force MaxDegreeOfParallelism to 1, while investigating scopes * Tried some more workarounds * Updated scopes and changed parallel to non parallel to ensure migration works * Missing scope * Make it parallel again - The secret is, the SuppressFlow needs to be when you create the task, but not on the await!. * Fixed issue when DEBUG_SCOPES is not added to tests. * Remove test exception * Try build on ubuntu again, even that we know it can be stuck. Just a test to see if all tests pass * Updated comment --------- Co-authored-by: kjac <[email protected]>
- Loading branch information
Showing
35 changed files
with
299 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/Umbraco.Core/Notifications/PostRuntimePremigrationsUpgradeNotification.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Umbraco.Cms.Core.Notifications; | ||
|
||
public class PostRuntimePremigrationsUpgradeNotification : INotification | ||
{ | ||
|
||
} |
53 changes: 0 additions & 53 deletions
53
src/Umbraco.Core/Services/DocumentUrlServiceInitializer.cs
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
src/Umbraco.Core/Services/DocumentUrlServiceInitializerNotificationHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Umbraco.Cms.Core.Events; | ||
using Umbraco.Cms.Core.Notifications; | ||
|
||
namespace Umbraco.Cms.Core.Services; | ||
|
||
public class DocumentUrlServiceInitializerNotificationHandler : INotificationAsyncHandler<UmbracoApplicationStartingNotification> | ||
{ | ||
private readonly IDocumentUrlService _documentUrlService; | ||
private readonly IRuntimeState _runtimeState; | ||
|
||
public DocumentUrlServiceInitializerNotificationHandler(IDocumentUrlService documentUrlService, IRuntimeState runtimeState) | ||
{ | ||
_documentUrlService = documentUrlService; | ||
_runtimeState = runtimeState; | ||
} | ||
|
||
public async Task HandleAsync(UmbracoApplicationStartingNotification notification, CancellationToken cancellationToken) | ||
{ | ||
if (_runtimeState.Level == RuntimeLevel.Upgrade) | ||
{ | ||
//Special case on the first upgrade, as the database is not ready yet. | ||
return; | ||
} | ||
|
||
await _documentUrlService.InitAsync( | ||
_runtimeState.Level <= RuntimeLevel.Install, | ||
cancellationToken); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.