From 6fca68639003ae353782362001b86f5eb3428938 Mon Sep 17 00:00:00 2001 From: Rowan Bottema Date: Thu, 1 Feb 2024 10:57:03 +0100 Subject: [PATCH] Don't process content items multiple times in the scheduled job A content item can be tagged with multiple tags, which would make them end up multiple times in the GetTaggedContentGuids list. Filtering out duplicates cleans this list and avoids doing duplicate processing. This speeds up the job greatly, especially in sites with heavy tag usage --- src/Geta.Optimizely.Tags/TagsScheduledJob.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Geta.Optimizely.Tags/TagsScheduledJob.cs b/src/Geta.Optimizely.Tags/TagsScheduledJob.cs index 20a8347..bacbcad 100644 --- a/src/Geta.Optimizely.Tags/TagsScheduledJob.cs +++ b/src/Geta.Optimizely.Tags/TagsScheduledJob.cs @@ -128,6 +128,7 @@ private static IEnumerable GetTaggedContentGuids(IEnumerable tags) { return tags.Where(x => x?.PermanentLinks != null) .SelectMany(x => x.PermanentLinks) + .Distinct() .ToList(); }