[backend/core] Replace sync DB call with async equivalent
This commit is contained in:
parent
173b01fbf3
commit
dc8511632b
1 changed files with 3 additions and 1 deletions
|
@ -347,7 +347,9 @@ public class NoteService(
|
||||||
|
|
||||||
if (note is { Renote.Id: not null, IsPureRenote: true })
|
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)
|
await db.Notes.Where(p => p.Id == note.Renote.Id)
|
||||||
.ExecuteUpdateAsync(p => p.SetProperty(n => n.RenoteCount, n => n.RenoteCount + diff));
|
.ExecuteUpdateAsync(p => p.SetProperty(n => n.RenoteCount, n => n.RenoteCount + diff));
|
||||||
|
|
Loading…
Add table
Reference in a new issue