1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 20:22:55 +08:00

Use a transaction when adding a beatmap

Fixes flakey unit test.
This commit is contained in:
Dean Herbert 2017-07-28 17:31:13 +09:00
parent bd79a69e2e
commit 6807caa752

View File

@ -56,7 +56,11 @@ namespace osu.Game.Beatmaps
/// <param name="beatmapSet">The beatmap to add.</param>
public void Add(BeatmapSetInfo beatmapSet)
{
Connection.InsertOrReplaceWithChildren(beatmapSet, true);
Connection.RunInTransaction(() =>
{
Connection.InsertOrReplaceWithChildren(beatmapSet, true);
});
BeatmapSetAdded?.Invoke(beatmapSet);
}