Skip to content

Commit

Permalink
Fix incorrect deletion of old log files
Browse files Browse the repository at this point in the history
  • Loading branch information
lwYeo committed Aug 18, 2021
1 parent 48a7386 commit 16290f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Crypto LP Compounder/Crypto LP Compounder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Copyright>Copyright © lwYeo 2021</Copyright>
<Company>lwYeo@github</Company>
<Authors>lwYeo</Authors>
<Version>0.1.14</Version>
<Version>0.1.15</Version>
<RepositoryType>GitHub</RepositoryType>
<RepositoryUrl>https://github.com/lwYeo/CryptoLP_Compounder</RepositoryUrl>
<Product>Crypto LP Compounder</Product>
Expand Down
4 changes: 2 additions & 2 deletions Crypto LP Compounder/Log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ private void DeleteOldLogs()

string[] logsToKeep =
Enumerable.Range(0, _DeleteLogAfterDays)
.Select(i => GetLogFileName(DateTime.Today.AddDays(i)))
.Select(i => GetLogFileName(DateTime.Today.AddDays(-i)))
.Concat(
Enumerable.Range(0, _DeleteLogAfterDays)
.Select(i => GetProcessLogFileName(DateTime.Today.AddDays(i))))
.Select(i => GetProcessLogFileName(DateTime.Today.AddDays(-i))))
.ToArray();

string[] logsToDelete = foundLogs.Except(logsToKeep).ToArray();
Expand Down

0 comments on commit 16290f0

Please sign in to comment.