Only catch RealmExceptions to avoid blocking the nested TimeoutException

This commit is contained in:
Dean Herbert
2022-01-19 10:58:59 +09:00
parent 49fcff190a
commit 261b4988f9

View File

@ -21,6 +21,7 @@ using osu.Game.Stores;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Scoring; using osu.Game.Scoring;
using Realms; using Realms;
using Realms.Exceptions;
#nullable enable #nullable enable
@ -427,7 +428,7 @@ namespace osu.Game.Database
throw new TimeoutException(@"Took too long to acquire lock"); throw new TimeoutException(@"Took too long to acquire lock");
} }
} }
catch (Exception e) catch (RealmException e)
{ {
// Compact may fail if the realm is in a bad state. // Compact may fail if the realm is in a bad state.
// We still want to continue with the blocking operation, though. // We still want to continue with the blocking operation, though.