fix some minor issues

This commit is contained in:
Stanley Dimant 2024-08-19 20:02:12 +02:00
parent 71afa6374e
commit 6b04452774
3 changed files with 44 additions and 7 deletions

View file

@ -48,7 +48,21 @@ public sealed class Plugin : IDalamudPlugin
.Select(f => new FileInfo(f))
.OrderByDescending(f => f.LastWriteTimeUtc).Skip(9))
{
file.Delete();
int attempts = 0;
bool deleted = false;
while (!deleted && attempts < 5)
{
try
{
file.Delete();
deleted = true;
}
catch
{
attempts++;
Thread.Sleep(500);
}
}
}
_host = new HostBuilder()