1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-17 22:17:25 +08:00

Merge pull request #11483 from peppy/fix-difficulty-calculation-deadlock

Fix deadlock scenario when calculating fallback difficulty
This commit is contained in:
Dan Balasescu 2021-01-14 21:30:25 +09:00 committed by GitHub
commit ef6245813b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -260,17 +260,10 @@ namespace osu.Game.Beatmaps
}
catch (BeatmapInvalidForRulesetException e)
{
// Conversion has failed for the given ruleset, so return the difficulty in the beatmap's default ruleset.
// Ensure the beatmap's default ruleset isn't the one already being converted to.
// This shouldn't happen as it means something went seriously wrong, but if it does an endless loop should be avoided.
if (rulesetInfo.Equals(beatmapInfo.Ruleset))
{
Logger.Error(e, $"Failed to convert {beatmapInfo.OnlineBeatmapID} to the beatmap's default ruleset ({beatmapInfo.Ruleset}).");
return new StarDifficulty();
}
return GetAsync(new DifficultyCacheLookup(key.Beatmap, key.Beatmap.Ruleset, key.OrderedMods)).Result;
return new StarDifficulty();
}
catch
{