Allow game folder migration to fail gracefully when cleanup cannot completely succeed

This commit is contained in:
Dean Herbert
2022-02-10 18:48:37 +09:00
parent 7081c418dd
commit 44f2d8a448
5 changed files with 66 additions and 20 deletions

View File

@ -413,7 +413,7 @@ namespace osu.Game
Scheduler.AddDelayed(GracefullyExit, 2000);
}
public void Migrate(string path)
public bool Migrate(string path)
{
Logger.Log($@"Migrating osu! data from ""{Storage.GetFullPath(string.Empty)}"" to ""{path}""...");
@ -432,14 +432,15 @@ namespace osu.Game
readyToRun.Wait();
(Storage as OsuStorage)?.Migrate(Host.GetStorage(path));
bool? cleanupSucceded = (Storage as OsuStorage)?.Migrate(Host.GetStorage(path));
Logger.Log(@"Migration complete!");
return cleanupSucceded != false;
}
finally
{
realmBlocker?.Dispose();
}
Logger.Log(@"Migration complete!");
}
protected override UserInputManager CreateUserInputManager() => new OsuUserInputManager();