1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 02:43:19 +08:00

Add logging of WorkingBeatmapCache.Invalidate calls

This commit is contained in:
Dean Herbert 2021-10-14 13:58:36 +09:00
parent 8d479bbe56
commit 09536cd733
2 changed files with 8 additions and 0 deletions

View File

@ -66,10 +66,14 @@ namespace osu.Game.Beatmaps
lock (workingCache) lock (workingCache)
{ {
var working = workingCache.FirstOrDefault(w => w.BeatmapInfo?.ID == info.ID); var working = workingCache.FirstOrDefault(w => w.BeatmapInfo?.ID == info.ID);
if (working != null) if (working != null)
{
Logger.Log($"Invalidating working beatmap cache for {info}");
workingCache.Remove(working); workingCache.Remove(working);
} }
} }
}
public virtual WorkingBeatmap GetWorkingBeatmap(BeatmapInfo beatmapInfo) public virtual WorkingBeatmap GetWorkingBeatmap(BeatmapInfo beatmapInfo)
{ {
@ -86,6 +90,7 @@ namespace osu.Game.Beatmaps
lock (workingCache) lock (workingCache)
{ {
var working = workingCache.FirstOrDefault(w => w.BeatmapInfo?.ID == beatmapInfo.ID); var working = workingCache.FirstOrDefault(w => w.BeatmapInfo?.ID == beatmapInfo.ID);
if (working != null) if (working != null)
return working; return working;

View File

@ -523,7 +523,10 @@ namespace osu.Game.Screens.Edit
var refetchedBeatmap = beatmapManager.GetWorkingBeatmap(Beatmap.Value.BeatmapInfo); var refetchedBeatmap = beatmapManager.GetWorkingBeatmap(Beatmap.Value.BeatmapInfo);
if (!(refetchedBeatmap is DummyWorkingBeatmap)) if (!(refetchedBeatmap is DummyWorkingBeatmap))
{
Logger.Log("Editor providing re-fetched beatmap post edit session");
Beatmap.Value = refetchedBeatmap; Beatmap.Value = refetchedBeatmap;
}
return base.OnExiting(next); return base.OnExiting(next);
} }