Skip to content

Commit

Permalink
Fix umbraco upgrade issues (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefankip committed Apr 1, 2020
1 parent b1b11c6 commit a7e07ed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
using Our.Umbraco.FullTextSearch.Interfaces;
using System;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Examine;
using Umbraco.Web.Search;

namespace Our.Umbraco.FullTextSearch.Components
{
[RuntimeLevel(MinLevel = RuntimeLevel.Run)]
[ComposeAfter(typeof(ExamineComposer))]
public class AddFullTextItemsToIndexComposer : ComponentComposer<AddFullTextItemsToIndex> { }
public class AddFullTextItemsToIndex : IComponent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Examine;
using Our.Umbraco.FullTextSearch.Interfaces;
using System;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Services;
Expand All @@ -9,6 +10,7 @@

namespace Our.Umbraco.FullTextSearch.Components
{
[RuntimeLevel(MinLevel = RuntimeLevel.Run)]
public class PerformCacheTasksComposer : ComponentComposer<PerformCacheTasksComponent>
{
}
Expand All @@ -25,7 +27,7 @@ public class PerformCacheTasksComponent : IComponent
private readonly BackgroundTaskRunner<IBackgroundTask> _performCacheTasksRunner;

public PerformCacheTasksComponent(
IProfilingLogger profilingLogger,
IProfilingLogger profilingLogger,
ILogger logger,
IContentService contentService,
ICacheService cacheService,
Expand All @@ -45,7 +47,7 @@ public PerformCacheTasksComponent(
public void Initialize()
{

var task = new PerformCacheTasks(_performCacheTasksRunner, 1000, 60*1000, _profilingLogger, _logger, _contentService, _cacheService, _examineManager, _valueSetBuilder, _fullTextConfig);
var task = new PerformCacheTasks(_performCacheTasksRunner, 1000, 60 * 1000, _profilingLogger, _logger, _contentService, _cacheService, _examineManager, _valueSetBuilder, _fullTextConfig);

_performCacheTasksRunner.TryAdd(task);
}
Expand Down Expand Up @@ -73,7 +75,7 @@ public PerformCacheTasks(IBackgroundTaskRunner<RecurringTaskBase> runner,
ICacheService cacheService,
IExamineManager examineManager,
IPublishedContentValueSetBuilder valueSetBuilder,
IConfig fullTextConfig)
IConfig fullTextConfig)
: base(runner, delayMilliseconds, periodMilliseconds)
{
_valueSetBuilder = valueSetBuilder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Examine;
using Our.Umbraco.FullTextSearch.Interfaces;
using System;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
Expand All @@ -12,6 +13,7 @@

namespace Our.Umbraco.FullTextSearch.Components
{
[RuntimeLevel(MinLevel = RuntimeLevel.Run)]
public class UpdateCacheOnPublishComposer : ComponentComposer<UpdateCacheOnPublish>
{
}
Expand Down Expand Up @@ -80,8 +82,8 @@ private void ContentCacheRefresher_CacheUpdated(ContentCacheRefresher sender, Ca
var total = long.MaxValue;
while (page * pageSize < total)
{
var descendants = _contentService.GetPagedDescendants(payload.Id, page++, pageSize, out total,
//order by shallowest to deepest, this allows us to check it's published state without checking every item
var descendants = _contentService.GetPagedDescendants(payload.Id, page++, pageSize, out total,
//order by shallowest to deepest, this allows us to check it's published state without checking every item
ordering: Ordering.By("Path", Direction.Ascending));

foreach (var descendant in descendants)
Expand Down

0 comments on commit a7e07ed

Please sign in to comment.