1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-12 04:03:20 +08:00

Fix hard crash when attempting to change folder location during a large import

Closes https://github.com/ppy/osu/issues/26067.
This commit is contained in:
Dean Herbert 2023-12-23 17:03:57 +09:00
parent fc56188b95
commit 8349cb7bbe
No known key found for this signature in database

View File

@ -527,14 +527,21 @@ namespace osu.Game
{
ManualResetEventSlim readyToRun = new ManualResetEventSlim();
bool success = false;
Scheduler.Add(() =>
{
realmBlocker = realm.BlockAllOperations("migration");
try
{
realmBlocker = realm.BlockAllOperations("migration");
success = true;
}
catch { }
readyToRun.Set();
}, false);
if (!readyToRun.Wait(30000))
if (!readyToRun.Wait(30000) || !success)
throw new TimeoutException("Attempting to block for migration took too long.");
bool? cleanupSucceded = (Storage as OsuStorage)?.Migrate(Host.GetStorage(path));