From 5e256d2ac07414b569790040160674d7d7a9a7e5 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 28 Jul 2022 20:12:21 +0200 Subject: [PATCH] Test logging. --- .../Assets/AssetUsageTracker_EventHandling.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetUsageTracker_EventHandling.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetUsageTracker_EventHandling.cs index 1f0603cfe..04bc4c670 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetUsageTracker_EventHandling.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetUsageTracker_EventHandling.cs @@ -5,6 +5,7 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== +using System.Text.Json; using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Options; using Squidex.Domain.Apps.Core.Tags; @@ -94,7 +95,6 @@ namespace Squidex.Domain.Apps.Entities.Assets void AddTagsToCache(DomainId key, HashSet? tags, long version) { - // Also cache null tags to keep them in as valid state in cache and store. var state = new State { Tags = tags }; // Write tags to a buffer so that we can write them to a store in batches. @@ -150,6 +150,8 @@ namespace Squidex.Domain.Apps.Entities.Assets await tagService.UpdateAsync(appId, TagGroups.Assets, updates); } + Console.WriteLine($"Writing tags: {JsonSerializer.Serialize(tagsPerApp)}"); + await store.WriteManyAsync(tagsPerAsset.Select(x => new SnapshotWriteJob(x.Key, x.Value, 0))); }