From dc8511632bce5268dbe30826720e3db2950db2fc Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Mon, 10 Jun 2024 19:42:06 +0200 Subject: [PATCH] [backend/core] Replace sync DB call with async equivalent --- Iceshrimp.Backend/Core/Services/NoteService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Iceshrimp.Backend/Core/Services/NoteService.cs b/Iceshrimp.Backend/Core/Services/NoteService.cs index 7fe2b2e1..e5b4e34a 100644 --- a/Iceshrimp.Backend/Core/Services/NoteService.cs +++ b/Iceshrimp.Backend/Core/Services/NoteService.cs @@ -347,7 +347,9 @@ public class NoteService( if (note is { Renote.Id: not null, IsPureRenote: true }) { - if (!db.Notes.Any(p => p.UserId == note.User.Id && p.RenoteId == note.Renote.Id && p.IsPureRenote)) + if (!await db.Notes.AnyAsync(p => p.UserId == note.User.Id && + p.RenoteId == note.Renote.Id && + p.IsPureRenote)) { await db.Notes.Where(p => p.Id == note.Renote.Id) .ExecuteUpdateAsync(p => p.SetProperty(n => n.RenoteCount, n => n.RenoteCount + diff));