reduce some more spam on log

master
UbitUmarov 2020-02-08 01:10:30 +00:00
parent c2ab11a51e
commit 22227fa0b8
2 changed files with 28 additions and 9 deletions

View File

@ -246,7 +246,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// Find all the embedded assets // Find all the embedded assets
HGUuidGatherer uuidGatherer = new HGUuidGatherer(m_scene.AssetService, string.Empty); HGUuidGatherer uuidGatherer = new HGUuidGatherer(m_scene.AssetService, string.Empty);
uuidGatherer.AddForInspection(asset.FullID); uuidGatherer.AddForInspection(asset.FullID);
uuidGatherer.GatherAll(); uuidGatherer.GatherAll(true);
// Check which assets already exist in the destination server // Check which assets already exist in the destination server

View File

@ -29,8 +29,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using System.Text.RegularExpressions; using System.Text;
using System.Threading;
using log4net; using log4net;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.Assets; using OpenMetaverse.Assets;
@ -69,6 +68,8 @@ namespace OpenSim.Region.Framework.Scenes
public HashSet<UUID> UncertainAssetsUUIDs { get; private set; } public HashSet<UUID> UncertainAssetsUUIDs { get; private set; }
public int possibleNotAssetCount { get; set; } public int possibleNotAssetCount { get; set; }
public int ErrorCount { get; private set; } public int ErrorCount { get; private set; }
private bool verbose = true;
/// <summary> /// <summary>
/// Gets the next UUID to inspect. /// Gets the next UUID to inspect.
/// </summary> /// </summary>
@ -267,20 +268,36 @@ namespace OpenSim.Region.Framework.Scenes
GetAssetUuids(nextToInspect); GetAssetUuids(nextToInspect);
return m_assetUuidsToInspect.Count != 0; return m_assetUuidsToInspect.Count > 0;
} }
/// <summary> /// <summary>
/// Gathers all remaining asset UUIDS no matter how many calls are required to the asset service. /// Gathers all remaining asset UUIDS no matter how many calls are required to the asset service.
/// </summary> /// </summary>
/// <returns>false if gathering is already complete, true otherwise</returns> /// <returns>false if gathering is already complete, true otherwise</returns>
public bool GatherAll() public bool GatherAll(bool report = false)
{ {
if (Complete) if (Complete)
return false; return false;
if(report)
verbose = false;
while (GatherNext()); while (GatherNext());
if (report && FailedUUIDs.Count > 0)
{
StringBuilder sb = new StringBuilder(512);
int i = FailedUUIDs.Count;
sb.Append("[UUID GATHERER]: UUIDs that are not assets or really missing assets:\n\t");
foreach (UUID id in FailedUUIDs)
{
sb.Append(id);
if (--i > 0)
sb.Append(',');
}
m_log.Debug(sb.ToString());
}
return true; return true;
} }
@ -321,6 +338,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
catch (Exception e) catch (Exception e)
{ {
if(verbose)
m_log.ErrorFormat("[UUID GATHERER]: Failed to get asset {0} : {1}", assetUuid, e.Message); m_log.ErrorFormat("[UUID GATHERER]: Failed to get asset {0} : {1}", assetUuid, e.Message);
ErrorCount++; ErrorCount++;
FailedUUIDs.Add(assetUuid); FailedUUIDs.Add(assetUuid);
@ -381,6 +399,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
catch (Exception e) catch (Exception e)
{ {
if(verbose)
m_log.ErrorFormat("[UUID GATHERER]: Failed to gather uuids for asset with id {0} type {1}: {2}", assetUuid, assetType, e.Message); m_log.ErrorFormat("[UUID GATHERER]: Failed to gather uuids for asset with id {0} type {1}: {2}", assetUuid, assetType, e.Message);
GatheredUuids.Remove(assetUuid); GatheredUuids.Remove(assetUuid);
ErrorCount++; ErrorCount++;
@ -683,13 +702,13 @@ namespace OpenSim.Region.Framework.Scenes
: base(assetService, collector) : base(assetService, collector)
{ {
m_assetServerURL = assetServerURL; m_assetServerURL = assetServerURL;
if (!m_assetServerURL.EndsWith("/") && !m_assetServerURL.EndsWith("=")) if (!String.IsNullOrWhiteSpace(assetServerURL) && !m_assetServerURL.EndsWith("/") && !m_assetServerURL.EndsWith("="))
m_assetServerURL = m_assetServerURL + "/"; m_assetServerURL = m_assetServerURL + "/";
} }
protected override AssetBase GetAsset(UUID uuid) protected override AssetBase GetAsset(UUID uuid)
{ {
if (string.Empty == m_assetServerURL) if (String.IsNullOrWhiteSpace(m_assetServerURL))
return base.GetAsset(uuid); return base.GetAsset(uuid);
else else
return FetchAsset(uuid); return FetchAsset(uuid);