From f761714f1550517fe535b119e63f186ed77c3a93 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Wed, 13 Jul 2022 02:32:19 +0200 Subject: [PATCH] Removed transaction from the xp loop as it's causing database locking --- src/NadekoBot/Modules/Xp/XpService.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/NadekoBot/Modules/Xp/XpService.cs b/src/NadekoBot/Modules/Xp/XpService.cs index d832e56cd..552cf2095 100644 --- a/src/NadekoBot/Modules/Xp/XpService.cs +++ b/src/NadekoBot/Modules/Xp/XpService.cs @@ -174,8 +174,6 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand var gxps = new List(globalToAdd.Count); await using (var ctx = _db.GetDbContext()) { - await using var tran = await ctx.Database.BeginTransactionAsync(); - // update global user xp in batches // group by xp amount and update the same amounts at the same time foreach (var group in globalToAdd.GroupBy(x => x.Value.XpAmount, x => x.Key)) @@ -209,8 +207,6 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand gxps.AddRange(items); } } - - await tran.CommitAsync(); } foreach (var du in dus)