diff options
author | UbitUmarov | 2017-05-26 05:32:59 +0100 |
---|---|---|
committer | UbitUmarov | 2017-05-26 05:32:59 +0100 |
commit | 8f10db0a6a4831cded816e6d08b09fe0e47c77b4 (patch) | |
tree | 7812221b8330fabbc730379b8b12876c4e7f11b0 | |
parent | change opensim-ode.sh to use the ode engine defined on opensim.ini (diff) | |
download | opensim-SC_OLD-8f10db0a6a4831cded816e6d08b09fe0e47c77b4.zip opensim-SC_OLD-8f10db0a6a4831cded816e6d08b09fe0e47c77b4.tar.gz opensim-SC_OLD-8f10db0a6a4831cded816e6d08b09fe0e47c77b4.tar.bz2 opensim-SC_OLD-8f10db0a6a4831cded816e6d08b09fe0e47c77b4.tar.xz |
mantis 8181: don't try to delete contents of a non exitent folder
-rw-r--r-- | OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 610e279..e5ac17d 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | |||
@@ -646,7 +646,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
646 | if (m_LogLevel >= 2) | 646 | if (m_LogLevel >= 2) |
647 | m_log.Debug("[FLOTSAM ASSET CACHE]: Clearing caches."); | 647 | m_log.Debug("[FLOTSAM ASSET CACHE]: Clearing caches."); |
648 | 648 | ||
649 | if (m_FileCacheEnabled) | 649 | if (m_FileCacheEnabled && Directory.Exists(m_CacheDirectory)) |
650 | { | 650 | { |
651 | foreach (string dir in Directory.GetDirectories(m_CacheDirectory)) | 651 | foreach (string dir in Directory.GetDirectories(m_CacheDirectory)) |
652 | { | 652 | { |
@@ -681,10 +681,10 @@ namespace OpenSim.Region.CoreModules.Asset | |||
681 | // before cleaning up expired files we must scan the objects in the scene to make sure that we retain | 681 | // before cleaning up expired files we must scan the objects in the scene to make sure that we retain |
682 | // such local assets if they have not been recently accessed. | 682 | // such local assets if they have not been recently accessed. |
683 | TouchAllSceneAssets(false); | 683 | TouchAllSceneAssets(false); |
684 | 684 | if(Directory.Exists(m_CacheDirectory)) | |
685 | foreach (string dir in Directory.GetDirectories(m_CacheDirectory)) | ||
686 | { | 685 | { |
687 | CleanExpiredFiles(dir, purgeLine); | 686 | foreach (string dir in Directory.GetDirectories(m_CacheDirectory)) |
687 | CleanExpiredFiles(dir, purgeLine); | ||
688 | } | 688 | } |
689 | 689 | ||
690 | lock(timerLock) | 690 | lock(timerLock) |
@@ -706,6 +706,9 @@ namespace OpenSim.Region.CoreModules.Asset | |||
706 | { | 706 | { |
707 | try | 707 | try |
708 | { | 708 | { |
709 | if(!Directory.Exists(dir)) | ||
710 | return; | ||
711 | |||
709 | foreach (string file in Directory.GetFiles(dir)) | 712 | foreach (string file in Directory.GetFiles(dir)) |
710 | { | 713 | { |
711 | if (File.GetLastAccessTime(file) < purgeLine) | 714 | if (File.GetLastAccessTime(file) < purgeLine) |
@@ -869,6 +872,9 @@ namespace OpenSim.Region.CoreModules.Asset | |||
869 | /// <returns></returns> | 872 | /// <returns></returns> |
870 | private int GetFileCacheCount(string dir) | 873 | private int GetFileCacheCount(string dir) |
871 | { | 874 | { |
875 | if(!Directory.Exists(dir)) | ||
876 | return 0; | ||
877 | |||
872 | int count = Directory.GetFiles(dir).Length; | 878 | int count = Directory.GetFiles(dir).Length; |
873 | 879 | ||
874 | foreach (string subdir in Directory.GetDirectories(dir)) | 880 | foreach (string subdir in Directory.GetDirectories(dir)) |
@@ -987,6 +993,9 @@ namespace OpenSim.Region.CoreModules.Asset | |||
987 | /// </summary> | 993 | /// </summary> |
988 | private void ClearFileCache() | 994 | private void ClearFileCache() |
989 | { | 995 | { |
996 | if(!Directory.Exists(m_CacheDirectory)) | ||
997 | return; | ||
998 | |||
990 | foreach (string dir in Directory.GetDirectories(m_CacheDirectory)) | 999 | foreach (string dir in Directory.GetDirectories(m_CacheDirectory)) |
991 | { | 1000 | { |
992 | try | 1001 | try |