File tree Expand file tree Collapse file tree 4 files changed +36
-4
lines changed
src/Umbraco.Cms.Integrations.Search.Algolia
App_Plugins/UmbracoCms.Integrations/Search/Algolia Expand file tree Collapse file tree 4 files changed +36
-4
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,9 @@ public void Compose(IUmbracoBuilder builder)
2323 builder . AddNotificationHandler < UmbracoApplicationStartingNotification , RunAlgoliaIndicesMigration > ( ) ;
2424
2525 builder . AddNotificationAsyncHandler < ContentCacheRefresherNotification , AlgoliaContentCacheRefresherHandler > ( ) ;
26-
27- builder . Services . AddOptions < AlgoliaSettings > ( )
26+ builder . AddNotificationAsyncHandler < ContentPublishedNotification , AlgoliaContentPublishedHandler > ( ) ;
27+
28+ builder . Services . AddOptions < AlgoliaSettings > ( )
2829 . Bind ( builder . Config . GetSection ( Constants . SettingsPath ) ) ;
2930
3031 builder . Services . AddSingleton < IAlgoliaIndexService , AlgoliaIndexService > ( ) ;
Original file line number Diff line number Diff line change 11{
22 "name": "Umbraco.Cms.Integrations.Search.Algolia",
3- "version": "1 .3.1 ",
3+ "version": "2 .3.3 ",
44 "allowPackageTelemetry": true,
55 "javascript": [
66 "~/App_Plugins/UmbracoCms.Integrations/Search/Algolia/js/algolia.service.js",
Original file line number Diff line number Diff line change 1+ using Umbraco . Cms . Core . Cache ;
2+ using Umbraco . Cms . Core . Events ;
3+ using Umbraco . Cms . Core . Notifications ;
4+ using Umbraco . Cms . Core . Sync ;
5+ using Umbraco . Extensions ;
6+
7+ namespace Umbraco . Cms . Integrations . Search . Algolia . Handlers
8+ {
9+ public class AlgoliaContentPublishedHandler : INotificationAsyncHandler < ContentPublishedNotification >
10+ {
11+ private readonly IServerRoleAccessor _serverRoleAccessor ;
12+ private readonly DistributedCache _distributedCache ;
13+
14+ public AlgoliaContentPublishedHandler (
15+ IServerRoleAccessor serverRoleAccessor ,
16+ DistributedCache distributedCache )
17+ {
18+ _serverRoleAccessor = serverRoleAccessor ;
19+ _distributedCache = distributedCache ;
20+ }
21+
22+ public Task HandleAsync ( ContentPublishedNotification notification , CancellationToken cancellationToken )
23+ {
24+ if ( _serverRoleAccessor . CurrentServerRole == ServerRole . SchedulingPublisher )
25+ {
26+ _distributedCache . RefreshAllContentCache ( ) ;
27+ }
28+ return Task . CompletedTask ;
29+ }
30+ }
31+ }
Original file line number Diff line number Diff line change 1313 <PackageIconUrl ></PackageIconUrl >
1414 <PackageProjectUrl >https://github.com/umbraco/Umbraco.Cms.Integrations/tree/main/src/Umbraco.Cms.Integrations.Search.Algolia</PackageProjectUrl >
1515 <RepositoryUrl >https://github.com/umbraco/Umbraco.Cms.Integrations</RepositoryUrl >
16- <Version >2.3.2 </Version >
16+ <Version >2.3.3 </Version >
1717 <Authors >Umbraco HQ</Authors >
1818 <Company >Umbraco</Company >
1919 <PackageTags >Umbraco;Umbraco-Marketplace</PackageTags >
You can’t perform that action at this time.
0 commit comments