mantis 8181: don't try to delete contents of a non exitent folder
parent
426f2130fc
commit
8f10db0a6a
|
@ -646,7 +646,7 @@ namespace OpenSim.Region.CoreModules.Asset
|
|||
if (m_LogLevel >= 2)
|
||||
m_log.Debug("[FLOTSAM ASSET CACHE]: Clearing caches.");
|
||||
|
||||
if (m_FileCacheEnabled)
|
||||
if (m_FileCacheEnabled && Directory.Exists(m_CacheDirectory))
|
||||
{
|
||||
foreach (string dir in Directory.GetDirectories(m_CacheDirectory))
|
||||
{
|
||||
|
@ -681,9 +681,9 @@ namespace OpenSim.Region.CoreModules.Asset
|
|||
// before cleaning up expired files we must scan the objects in the scene to make sure that we retain
|
||||
// such local assets if they have not been recently accessed.
|
||||
TouchAllSceneAssets(false);
|
||||
|
||||
foreach (string dir in Directory.GetDirectories(m_CacheDirectory))
|
||||
if(Directory.Exists(m_CacheDirectory))
|
||||
{
|
||||
foreach (string dir in Directory.GetDirectories(m_CacheDirectory))
|
||||
CleanExpiredFiles(dir, purgeLine);
|
||||
}
|
||||
|
||||
|
@ -706,6 +706,9 @@ namespace OpenSim.Region.CoreModules.Asset
|
|||
{
|
||||
try
|
||||
{
|
||||
if(!Directory.Exists(dir))
|
||||
return;
|
||||
|
||||
foreach (string file in Directory.GetFiles(dir))
|
||||
{
|
||||
if (File.GetLastAccessTime(file) < purgeLine)
|
||||
|
@ -869,6 +872,9 @@ namespace OpenSim.Region.CoreModules.Asset
|
|||
/// <returns></returns>
|
||||
private int GetFileCacheCount(string dir)
|
||||
{
|
||||
if(!Directory.Exists(dir))
|
||||
return 0;
|
||||
|
||||
int count = Directory.GetFiles(dir).Length;
|
||||
|
||||
foreach (string subdir in Directory.GetDirectories(dir))
|
||||
|
@ -987,6 +993,9 @@ namespace OpenSim.Region.CoreModules.Asset
|
|||
/// </summary>
|
||||
private void ClearFileCache()
|
||||
{
|
||||
if(!Directory.Exists(m_CacheDirectory))
|
||||
return;
|
||||
|
||||
foreach (string dir in Directory.GetDirectories(m_CacheDirectory))
|
||||
{
|
||||
try
|
||||
|
|
Loading…
Reference in New Issue