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:
commit
ee0bd69e24
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user