[backend/federation] Delay backfilling for new notes to allow them time to collect replies

This commit is contained in:
Kopper 2024-09-14 11:13:53 +03:00 committed by Laura Hausmann
parent 5300aa069b
commit 23adf8bce6
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -345,7 +345,12 @@ public class NoteService(
};
logger.LogDebug("Enqueueing reply collection fetch for note {noteId}", note.Id);
// Delay reply backfilling for brand new notes to allow them time to collect replies.
if (note.CreatedAt.AddHours(3) <= DateTime.UtcNow)
await queueSvc.BackfillQueue.EnqueueAsync(jobData);
else
await queueSvc.BackfillQueue.ScheduleAsync(jobData, DateTime.UtcNow.AddHours(3));
}
return note;