map image service: always try to delete a map tile, before saving a new one; ubode cosmetics that where on disk"

This commit is contained in:
UbitUmarov
2022-08-14 00:23:16 +01:00
parent 7b334bc7d8
commit aad0c3c60e
4 changed files with 91 additions and 101 deletions

View File

@@ -148,7 +148,6 @@ namespace OpenSim.Services.MapImageService
}
catch (Exception e)
{
m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to save delete file {0}: {1}", fileName, e);
reason = e.Message;
return false;
@@ -157,7 +156,6 @@ namespace OpenSim.Services.MapImageService
return UpdateMultiResolutionFiles(x, y, scopeID, out reason);
}
// When large varregions start up, they can send piles of new map tiles. This causes
// this multi-resolution routine to be called a zillion times an causes much CPU
// time to be spent creating multi-resolution tiles that will be replaced when
@@ -361,22 +359,16 @@ namespace OpenSim.Services.MapImageService
ntiles++;
}
// Write the modified output
if (ntiles == 0)
File.Delete(outputFile);
else
try
{
try
{
File.Delete(outputFile);
if (ntiles > 0)
output.Save(outputFile, ImageFormat.Jpeg);
}
catch (Exception e)
{
m_log.WarnFormat("[MAP IMAGE SERVICE]: Oops on saving {0} {1}", outputFile, e);
}
} // Save also as png?
}
catch (Exception e)
{
m_log.WarnFormat("[MAP IMAGE SERVICE]: Oops on saving {0} {1}", outputFile, e);
}
output.Dispose();
return true;