1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 08:52:55 +08:00

Merge pull request #26072 from peppy/fix-migration-hard-crash

Fix hard crash when attempting to change folder location during a large import
This commit is contained in:
Dan Balasescu 2023-12-24 00:09:13 +09:00 committed by GitHub
commit ee0bd69e24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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));