1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-08-21 21:54:07 +02:00

Ignore errors in automatic cache clearing

Closes 
This commit is contained in:
2018-01-13 15:35:20 +01:00
parent 804c739038
commit 4f8c778ba0

@@ -36,8 +36,14 @@ namespace TweetDuck.Core.Utils{
} }
else if (shouldRun && AutoClearTimer == null){ else if (shouldRun && AutoClearTimer == null){
AutoClearTimer = new Timer(state => { AutoClearTimer = new Timer(state => {
if (AutoClearTimer != null && CalculateCacheSize() >= Program.SystemConfig.ClearCacheThreshold*1024L*1024L){ if (AutoClearTimer != null){
SetClearOnExit(); try{
if (CalculateCacheSize() >= Program.SystemConfig.ClearCacheThreshold*1024L*1024L){
SetClearOnExit();
}
}catch(Exception){
// TODO should probably log errors and report them at some point
}
} }
}, null, TimeSpan.FromSeconds(30), TimeSpan.FromHours(4)); }, null, TimeSpan.FromSeconds(30), TimeSpan.FromHours(4));
} }