mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:33:30 +08:00
Add simple retry logic on file copy failure (may be in use)
This commit is contained in:
parent
a11be07bb1
commit
984f27c107
@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Configuration;
|
||||
@ -95,7 +96,20 @@ namespace osu.Game.IO
|
||||
if (IGNORE_FILES.Contains(fi.Name))
|
||||
continue;
|
||||
|
||||
fi.CopyTo(Path.Combine(destination.FullName, fi.Name), true);
|
||||
int tries = 5;
|
||||
|
||||
while (tries-- > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
fi.CopyTo(Path.Combine(destination.FullName, fi.Name), true);
|
||||
break;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Thread.Sleep(50);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (DirectoryInfo dir in source.GetDirectories())
|
||||
|
Loading…
Reference in New Issue
Block a user