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:
parent
fc56188b95
commit
8349cb7bbe
@ -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