Added a fix from 1.9 branch for repeaters

This commit is contained in:
Kwoth
2021-07-21 18:55:08 +02:00
parent b84f40def6
commit e67f659a8a

View File

@@ -135,8 +135,9 @@ where ((guildid >> 22) % {_creds.TotalShards}) == {_client.ShardId};")
var toTrigger = await uow.Repeaters var toTrigger = await uow.Repeaters
.AsNoTracking() .AsNoTracking()
.Where(x => x.GuildId == guildId)
.Skip(index) .Skip(index)
.FirstOrDefaultAsyncEF(x => x.GuildId == guildId); .FirstOrDefaultAsyncEF();
if (toTrigger is null) if (toTrigger is null)
return false; return false;
@@ -361,8 +362,9 @@ where ((guildid >> 22) % {_creds.TotalShards}) == {_client.ShardId};")
using var uow = _db.GetDbContext(); using var uow = _db.GetDbContext();
var toRemove = await uow.Repeaters var toRemove = await uow.Repeaters
.AsNoTracking() .AsNoTracking()
.Where(x => x.GuildId == guildId)
.Skip(index) .Skip(index)
.FirstOrDefaultAsyncEF(x => x.GuildId == guildId); .FirstOrDefaultAsyncEF();
if (toRemove is null) if (toRemove is null)
return null; return null;
@@ -393,8 +395,9 @@ where ((guildid >> 22) % {_creds.TotalShards}) == {_client.ShardId};")
var toToggle = await uow var toToggle = await uow
.Repeaters .Repeaters
.AsQueryable() .AsQueryable()
.Where(x => x.GuildId == guildId)
.Skip(index) .Skip(index)
.FirstOrDefaultAsyncEF(x => x.GuildId == guildId); .FirstOrDefaultAsyncEF();
if (toToggle is null) if (toToggle is null)
return null; return null;