From 379105e8370faad7e888d808add14d4c85805f3a Mon Sep 17 00:00:00 2001 From: kim Date: Tue, 8 Apr 2025 18:39:08 +0100 Subject: [PATCH] remove trim-after-insert behaviour --- internal/cache/timeline/status.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/internal/cache/timeline/status.go b/internal/cache/timeline/status.go index c20ffc0fb..f0f4be448 100644 --- a/internal/cache/timeline/status.go +++ b/internal/cache/timeline/status.go @@ -561,7 +561,7 @@ func (t *StatusTimeline) InsertOne(status *gtsmodel.Status, prepared *apimodel.S } if status.BoostOfID != "" { - // Check through top $repeatBoostDepth number of timeline items. + // Check through top $repeatBoostDepth number of items. for i, value := range t.cache.RangeUnsafe(structr.Desc) { if i >= repeatBoostDepth { break @@ -576,8 +576,8 @@ func (t *StatusTimeline) InsertOne(status *gtsmodel.Status, prepared *apimodel.S } } - // Insert new status into timeline. - if t.cache.Insert(&StatusMeta{ + // Insert new timeline status. + t.cache.Insert(&StatusMeta{ ID: status.ID, AccountID: status.AccountID, BoostOfID: status.BoostOfID, @@ -585,12 +585,7 @@ func (t *StatusTimeline) InsertOne(status *gtsmodel.Status, prepared *apimodel.S repeatBoost: skip, loaded: nil, prepared: prepared, - }) > t.max { - - // If cache reached beyond - // maximum, perform a trim. - t.Trim() - } + }) return }