From 6a4564869baf3ef6a4de2de251763277c5f0ef9a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 12 May 2020 00:56:47 +0100 Subject: [PATCH] flotsam file touch before expire: gatherer.GatherAll already touchs and tries to fecth all assets. This is nasty to use anyway.. avoid it --- .../CoreModules/Asset/FlotsamAssetCache.cs | 45 +++++-------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 0bd377c1a8..f5dfeb9156 100755 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -892,38 +892,6 @@ namespace OpenSim.Region.CoreModules.Asset gatherer.AddForInspection(e); gatherer.GatherAll(); - if(!m_timerRunning && !storeUncached) - return; - - foreach (UUID assetID in gatherer.GatheredUuids.Keys) - { - if (!assetsFound.ContainsKey(assetID)) - { - string filename = GetFileName(assetID.ToString()); - - if (File.Exists(filename)) - { - UpdateFileLastAccessTime(filename); - assetsFound[assetID] = true; - } - else if (storeUncached) - { - AssetBase cachedAsset = m_AssetService.Get(assetID.ToString()); - if (cachedAsset == null && gatherer.GatheredUuids[assetID] != (sbyte)AssetType.Unknown) - assetsFound[assetID] = false; - else - assetsFound[assetID] = true; - } - } - else if (!assetsFound[assetID]) - { - m_log.DebugFormat( - "[FLOTSAM ASSET CACHE]: Could not find asset {0}, type {1} referenced by object {2} at {3} in scene {4} when pre-caching all scene assets", - assetID, gatherer.GatheredUuids[assetID], e.Name, e.AbsolutePosition, s.Name); - } - } - - gatherer.GatheredUuids.Clear(); if(!m_timerRunning && !storeUncached) return; @@ -932,9 +900,20 @@ namespace OpenSim.Region.CoreModules.Asset }); if(!m_timerRunning && !storeUncached) break; + gatherer.GatherAll(); } - return assetsFound.Count; + gatherer.GatherAll(); + if(gatherer.FailedUUIDs.Count > 0) + m_log.WarnFormat("[FLOTSAM ASSET CACHE] expire files IDs not found as asset:{0}", gatherer.FailedUUIDs.Count); + + int count = gatherer.GatheredUuids.Count; + gatherer.GatheredUuids.Clear(); + gatherer.FailedUUIDs.Clear(); + gatherer.UncertainAssetsUUIDs.Clear(); + + GC.Collect(); + return count; } ///