diff options
author | Kenneth Skovhede <kenneth@hexad.dk> | 2014-08-18 00:54:14 +0400 |
---|---|---|
committer | Kenneth Skovhede <kenneth@hexad.dk> | 2014-08-18 00:54:14 +0400 |
commit | 3e04e1afec9b41bc8eba4f8ddfa3669bdcf7565f (patch) | |
tree | b67e01d97b9eae141d3f33f029f743e2766b7c0a /Duplicati/Library/Utility | |
parent | ef3a62bf7217fce45fda1795d36fffcd4f8eb863 (diff) |
Fixed logic for deleting old temp files
Diffstat (limited to 'Duplicati/Library/Utility')
-rw-r--r-- | Duplicati/Library/Utility/TempFile.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Duplicati/Library/Utility/TempFile.cs b/Duplicati/Library/Utility/TempFile.cs index 81930b6bb..1db73c51f 100644 --- a/Duplicati/Library/Utility/TempFile.cs +++ b/Duplicati/Library/Utility/TempFile.cs @@ -105,11 +105,11 @@ namespace Duplicati.Library.Utility /// <param name="errorcallback">An optional callback method for logging errors</param>
public static void RemoveOldApplicationTempFiles(Action<string, Exception> errorcallback = null)
{
- var expired = DateTime.UtcNow.AddMonths(1);
+ var expires = TimeSpan.FromDays(30);
foreach(var e in GetApplicationTempFiles())
try
{
- if (System.IO.File.GetLastWriteTimeUtc(e) < expired)
+ if (DateTime.Now > (System.IO.File.GetLastWriteTimeUtc(e) + expires))
System.IO.File.Delete(e);
}
catch (Exception ex)
|