From 9b633b789a03ed3d8a594891b4b811baee1411e4 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Fri, 9 Oct 2026 12:54:36 -0700 Subject: [PATCH] Restore Container-keyed caches --- src/org/labkey/targetedms/TargetedMSManager.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/org/labkey/targetedms/TargetedMSManager.java b/src/org/labkey/targetedms/TargetedMSManager.java index beb53dc11..a586bc4a5 100644 --- a/src/org/labkey/targetedms/TargetedMSManager.java +++ b/src/org/labkey/targetedms/TargetedMSManager.java @@ -89,7 +89,6 @@ import org.labkey.api.targetedms.TargetedMSService; import org.labkey.api.targetedms.model.SampleFileInfo; import org.labkey.api.util.FileUtil; -import org.labkey.api.util.GUID; import org.labkey.api.util.StringUtilsLabKey; import org.labkey.api.util.logging.LogHelper; import org.labkey.api.view.NotFoundException; @@ -165,7 +164,7 @@ private TargetedMSManager() * A cache to make it faster to render QC folders. A number of API calls come from the * client rendering the overview, all of which need to know the enabled configs. */ - private static final Cache> _metricCache = CacheManager.getBlockingCache(1000, TimeUnit.HOURS.toMillis(1), "Enabled QC metric configs", + private static final Cache> _metricCache = CacheManager.getBlockingCache(Container.class, 1000, TimeUnit.HOURS.toMillis(1), "Enabled QC metric configs", (_, argument) -> { if (!(argument instanceof TargetedMSSchema schema)) @@ -2438,7 +2437,7 @@ private static Double getValue(Object o) public static List getAllQCMetricConfigurations(TargetedMSSchema schema) { - return _metricCache.get(schema.getContainer().getEntityId(), schema, null); + return _metricCache.get(schema.getContainer(), schema, null); } public static List getEnabledQCMetricConfigurations(TargetedMSSchema schema) { @@ -3063,7 +3062,7 @@ public static Map getQCFolderDateRange(Container container) */ public void clearQCMetricCache(Container container, boolean clearMetricValues) { - getSchema().getScope().addCommitTask(() -> _metricCache.remove(container.getEntityId()), DbScope.CommitTaskOption.IMMEDIATE, DbScope.CommitTaskOption.POSTCOMMIT, DbScope.CommitTaskOption.POSTROLLBACK); + getSchema().getScope().addCommitTask(() -> _metricCache.remove(container), DbScope.CommitTaskOption.IMMEDIATE, DbScope.CommitTaskOption.POSTCOMMIT, DbScope.CommitTaskOption.POSTROLLBACK); if (clearMetricValues) {