[backend/core] Fix race condition in NoteResolver.UpdatePinnedNotesAsync
This commit is contained in:
parent
7e93059368
commit
e1bdd7d0f4
1 changed files with 3 additions and 1 deletions
|
@ -1163,7 +1163,9 @@ public class NoteService(
|
||||||
collection = await objectResolver.ResolveObject(collection, force: true) as ASOrderedCollection;
|
collection = await objectResolver.ResolveObject(collection, force: true) as ASOrderedCollection;
|
||||||
if (collection is not { Items: not null }) return;
|
if (collection is not { Items: not null }) return;
|
||||||
|
|
||||||
var items = await collection.Items.Take(10).Select(p => objectResolver.ResolveObject(p)).AwaitAllAsync();
|
var items = await collection.Items.Take(10)
|
||||||
|
.Select(p => objectResolver.ResolveObject(p))
|
||||||
|
.AwaitAllNoConcurrencyAsync();
|
||||||
var notes = await items.OfType<ASNote>()
|
var notes = await items.OfType<ASNote>()
|
||||||
.Select(p => ResolveNoteAsync(p.Id, p, null, true))
|
.Select(p => ResolveNoteAsync(p.Id, p, null, true))
|
||||||
.AwaitAllNoConcurrencyAsync();
|
.AwaitAllNoConcurrencyAsync();
|
||||||
|
|
Loading…
Add table
Reference in a new issue