From a18d687f1880b1a35d3067953ccc8690354cd106 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Wed, 30 Sep 2026 01:41:48 +0200 Subject: [PATCH] [#67] OrganicService: Use ConcurrentDictionary --- Elwig/Services/OrganicService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Elwig/Services/OrganicService.cs b/Elwig/Services/OrganicService.cs index ae76e29..91ede7a 100644 --- a/Elwig/Services/OrganicService.cs +++ b/Elwig/Services/OrganicService.cs @@ -1,6 +1,7 @@ using Elwig.Helpers; using Elwig.Models.Entities; using System; +using System.Collections.Concurrent; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -47,7 +48,7 @@ namespace Elwig.Services { (CategoriesOfProduct.Contains(TracesCategoryOfProduct.UNPROCESSED_PLANT_PRODUCTS_INCLUDING_SEEDS) || CategoriesOfProduct.Contains(TracesCategoryOfProduct.WINE)); } - private static readonly Dictionary _memberCerts = []; + private static readonly ConcurrentDictionary _memberCerts = []; public async static Task GetTracesCertificates(Member m, bool? tryNameAndAddress = null) { if (_memberCerts.TryGetValue(m.MgNr, out var entry) && entry.Timestamp >= DateTime.Now.AddDays(-1))