fix: Cleans up archiving and fixes wrong relative path used (#825)
This commit is contained in:
parent
507eba34a8
commit
fe0abc4a8f
2 changed files with 10 additions and 7 deletions
|
|
@ -314,7 +314,7 @@ namespace Server.Saves
|
|||
foreach (var (rangeStart, sortedBackups) in items)
|
||||
{
|
||||
var backups = sortedBackups.Values;
|
||||
if (backups.Count == 0)
|
||||
if (backups.Count <= minimum)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
@ -397,7 +397,9 @@ namespace Server.Saves
|
|||
|
||||
if (TryGetDate(name, out var date))
|
||||
{
|
||||
items.Add(date, item);
|
||||
// Might give wrong results if there is a file that matches:
|
||||
// Example: 2021-09-01, and 2021-09-01-00
|
||||
items[date] = item;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -435,7 +437,6 @@ namespace Server.Saves
|
|||
}
|
||||
catch
|
||||
{
|
||||
logger.Warning($"Path was not in the correct date format: {value}");
|
||||
date = DateTime.MinValue;
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue