From 23adf8bce6ecdc472c8c4d5b6c77120879a2fe70 Mon Sep 17 00:00:00 2001 From: Kopper Date: Sat, 14 Sep 2024 11:13:53 +0300 Subject: [PATCH] [backend/federation] Delay backfilling for new notes to allow them time to collect replies --- Iceshrimp.Backend/Core/Services/NoteService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Iceshrimp.Backend/Core/Services/NoteService.cs b/Iceshrimp.Backend/Core/Services/NoteService.cs index caa48c31..c6eb7da4 100644 --- a/Iceshrimp.Backend/Core/Services/NoteService.cs +++ b/Iceshrimp.Backend/Core/Services/NoteService.cs @@ -345,7 +345,12 @@ public class NoteService( }; logger.LogDebug("Enqueueing reply collection fetch for note {noteId}", note.Id); - await queueSvc.BackfillQueue.EnqueueAsync(jobData); + + // 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;