1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-06 08:33:48 +08:00

Merge pull request #1070 from peppy/transaction-on-import

Use a transaction when adding a beatmap
This commit is contained in:
Thomas Müller
2017-07-28 10:57:01 +02:00
committed by GitHub
Unverified
+5 -1
View File
@@ -89,7 +89,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);
}