aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2019-01-02 20:12:24 +0100
committerBond_009 <bond.009@outlook.com>2019-01-02 20:12:24 +0100
commit8adcce5c6411dbb017e4c70d0651f5870207b090 (patch)
tree53f2c25c61dc31890e9305816dc8d090b19c7cec
parent0cafd7dfefe07bf8e1d997c384561707e1b22c6a (diff)
DeleteLogFileTask: only delete the .txt log files
-rw-r--r--Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs
index d5a7ccadb..b754d7cb5 100644
--- a/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs
+++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs
@@ -56,7 +56,8 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
// Delete log files more than n days old
var minDateModified = DateTime.UtcNow.AddDays(-ConfigurationManager.CommonConfiguration.LogFileRetentionDays);
- var filesToDelete = _fileSystem.GetFiles(ConfigurationManager.CommonApplicationPaths.LogDirectoryPath, true)
+ // Only delete the .txt log files, the *.log files created by serilog get managed by itself
+ var filesToDelete = _fileSystem.GetFiles(ConfigurationManager.CommonApplicationPaths.LogDirectoryPath, new[] { ".txt" }, true, true)
.Where(f => _fileSystem.GetLastWriteTimeUtc(f) < minDateModified)
.ToList();
@@ -64,8 +65,7 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
foreach (var file in filesToDelete)
{
- double percent = index;
- percent /= filesToDelete.Count;
+ double percent = index / filesToDelete.Count;
progress.Report(100 * percent);