From 6807caa752b1410f3ceda67e0ea5f685363ffab3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 28 Jul 2017 17:31:13 +0900 Subject: [PATCH] Use a transaction when adding a beatmap Fixes flakey unit test. --- osu.Game/Beatmaps/BeatmapStore.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/BeatmapStore.cs b/osu.Game/Beatmaps/BeatmapStore.cs index 4a7336535e..2c3ffe25b4 100644 --- a/osu.Game/Beatmaps/BeatmapStore.cs +++ b/osu.Game/Beatmaps/BeatmapStore.cs @@ -56,7 +56,11 @@ namespace osu.Game.Beatmaps /// The beatmap to add. public void Add(BeatmapSetInfo beatmapSet) { - Connection.InsertOrReplaceWithChildren(beatmapSet, true); + Connection.RunInTransaction(() => + { + Connection.InsertOrReplaceWithChildren(beatmapSet, true); + }); + BeatmapSetAdded?.Invoke(beatmapSet); }