summaryrefslogtreecommitdiff
path: root/internal/db/bundb/timeline.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2025-03-18 12:49:21 +0100
committerLibravatar GitHub <noreply@github.com>2025-03-18 12:49:21 +0100
commit59aac290e4ae8454ef8589b3f6a0442f2fdfeb90 (patch)
treea9eb60663a793bc2710a749a4ebf8ba7c6a3fe91 /internal/db/bundb/timeline.go
parent[feature] Application creation + management via API + settings panel (#3906) (diff)
downloadgotosocial-59aac290e4ae8454ef8589b3f6a0442f2fdfeb90.tar.xz
[performance] reindex public timeline + tinker with query a bit (#3918)
Diffstat (limited to 'internal/db/bundb/timeline.go')
-rw-r--r--internal/db/bundb/timeline.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/internal/db/bundb/timeline.go b/internal/db/bundb/timeline.go
index f343a28e8..404cb6601 100644
--- a/internal/db/bundb/timeline.go
+++ b/internal/db/bundb/timeline.go
@@ -229,6 +229,8 @@ func (t *timelineDB) GetPublicTimeline(
Where("? = ?", bun.Ident("status.visibility"), gtsmodel.VisibilityPublic).
// Ignore boosts.
Where("? IS NULL", bun.Ident("status.boost_of_id")).
+ // Only include statuses that aren't pending approval.
+ Where("? = ?", bun.Ident("status.pending_approval"), false).
// Select only IDs from table
Column("status.id")
@@ -255,9 +257,6 @@ func (t *timelineDB) GetPublicTimeline(
frontToBack = false
}
- // Only include statuses that aren't pending approval.
- q = q.Where("NOT ? = ?", bun.Ident("status.pending_approval"), true)
-
if limit > 0 {
// limit amount of statuses returned
q = q.Limit(limit)