1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 20:32:55 +08:00

Keep trying until delete succeeds

Turns out it can fail if file handles are still open.
This commit is contained in:
Dean Herbert 2017-10-19 23:33:27 +09:00
parent d9fd05a5af
commit 9b1ed5b3aa

View File

@ -97,8 +97,18 @@ namespace osu.Game
}
catch (MigrationFailedException)
{
using (var context = contextFactory.GetContext())
context.Database.EnsureDeleted();
while (true)
{
try
{
using (var context = contextFactory.GetContext())
{
context.Database.EnsureDeleted();
break;
}
}
catch { }
}
using (var context = contextFactory.GetContext())
context.Migrate();
}