Merge branch 'master' into realm-integration/stable-import-flow

This commit is contained in:
Dan Balasescu
2021-11-25 16:36:02 +09:00
committed by GitHub
6 changed files with 18 additions and 33 deletions

View File

@ -19,7 +19,7 @@ namespace osu.Game.Database
/// <param name="obj">The object to use as a reference when negotiating a local instance.</param>
/// <param name="lookupSource">An optional lookup source which will be used to query and populate a freshly retrieved replacement. If not provided, the refreshed object will still be returned but will not have any includes.</param>
/// <typeparam name="T">A valid EF-stored type.</typeparam>
protected virtual void Refresh<T>(ref T obj, IQueryable<T> lookupSource = null) where T : class, IHasPrimaryKey
protected void Refresh<T>(ref T obj, IQueryable<T> lookupSource = null) where T : class, IHasPrimaryKey
{
using (var usage = ContextFactory.GetForWrite())
{

View File

@ -14,6 +14,7 @@ using osu.Framework.Statistics;
using osu.Game.Configuration;
using osu.Game.Input.Bindings;
using osu.Game.Models;
using osu.Game.Stores;
using Realms;
#nullable enable
@ -121,6 +122,10 @@ namespace osu.Game.Database
transaction.Commit();
}
// clean up files after dropping any pending deletions.
// in the future we may want to only do this when the game is idle, rather than on every startup.
new RealmFileStore(this, storage).Cleanup();
}
/// <summary>