mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 18:52:55 +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;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
@ -95,7 +96,20 @@ namespace osu.Game.IO
|
|||||||
if (IGNORE_FILES.Contains(fi.Name))
|
if (IGNORE_FILES.Contains(fi.Name))
|
||||||
continue;
|
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())
|
foreach (DirectoryInfo dir in source.GetDirectories())
|
||||||
|
Loading…
Reference in New Issue
Block a user