1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-20 11:20:17 +08:00

Add some logging when FindWithRefresh triggers a slow realm refresh

This commit is contained in:
Dean Herbert
2025-10-10 13:36:28 +09:00
Unverified
parent 52f82c7e56
commit 94c7489c1c
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -284,6 +284,7 @@ namespace osu.Game.Beatmaps
/// <summary>
/// Returns a list of all usable <see cref="BeatmapSetInfo"/>s.
/// IMPORTANT: This should not be used outside of tests. Consider using <see cref="RealmDetachedBeatmapStore"/> instead.
/// </summary>
/// <returns>A list of available <see cref="BeatmapSetInfo"/>.</returns>
public List<BeatmapSetInfo> GetAllUsableBeatmapSets()
+2
View File
@@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Logging;
using Realms;
namespace osu.Game.Database
@@ -29,6 +30,7 @@ namespace osu.Game.Database
// It may be that we access this from the update thread before a refresh has taken place.
// To ensure that behaviour matches what we'd expect (the object generally *should be* available), force
// a refresh to bring in any off-thread changes immediately.
Logger.Log($"{nameof(FindWithRefresh)} triggered a realm refresh because it couldn't find the requested guid {id}");
realm.Refresh();
found = realm.Find<T>(id);
}