summaryrefslogtreecommitdiff
path: root/internal/cache
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cache')
-rw-r--r--internal/cache/timeline/status.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/cache/timeline/status.go b/internal/cache/timeline/status.go
index 7e6d3aa27..9e3957ac2 100644
--- a/internal/cache/timeline/status.go
+++ b/internal/cache/timeline/status.go
@@ -387,6 +387,9 @@ func (t *StatusTimeline) Load(
return nil, "", "", gtserror.Newf("error loading statuses: %w", err)
}
+ // Update nextPg cursor parameter for database query.
+ nextPageParams(nextPg, metas[len(metas)-1].ID, order)
+
// Prepare frontend API models for
// the cached statuses. For now this
// also does its own extra filtering.
@@ -536,6 +539,13 @@ func (t *StatusTimeline) InsertOne(status *gtsmodel.Status, prepared *apimodel.S
return false
}
+ // If item is beyond end of the
+ // timeline, don't bother adding.
+ if tailID := t.cache.Tail(); //
+ tailID == nil || status.ID < *tailID {
+ return false
+ }
+
if status.BoostOfID != "" {
// Check through top $repeatBoostDepth number of items.
for i, value := range t.cache.RangeUnsafe(structr.Desc) {