summaryrefslogtreecommitdiff
path: root/internal/processing/timeline/timeline.go
diff options
context:
space:
mode:
authorLibravatar kim <grufwub@gmail.com>2025-07-01 16:00:04 +0200
committerLibravatar kim <gruf@noreply.codeberg.org>2025-07-01 16:00:04 +0200
commit4f2aa792b33fdd5fb4b22dec813b3668d7190522 (patch)
tree1148a9322d04bf43c1c159df3079fb1790c5c154 /internal/processing/timeline/timeline.go
parent[chore] update go dependencies (#4304) (diff)
downloadgotosocial-4f2aa792b33fdd5fb4b22dec813b3668d7190522.tar.xz
[performance] add statusfilter cache to cache calculated status filtering results (#4303)
this adds another 'filter' type cache, similar to the visibility and mute caches, to cache the results of status filtering checks. for the moment this keeps all the check calls themselves within the frontend typeconversion code, but i may move this out of the typeconverter in a future PR (also removing the ErrHideStatus means of propagating a hidden status). also tweaks some of the cache invalidation hooks to not make unnecessary calls. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4303 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/processing/timeline/timeline.go')
-rw-r--r--internal/processing/timeline/timeline.go17
1 files changed, 1 insertions, 16 deletions
diff --git a/internal/processing/timeline/timeline.go b/internal/processing/timeline/timeline.go
index a37785879..64d33e430 100644
--- a/internal/processing/timeline/timeline.go
+++ b/internal/processing/timeline/timeline.go
@@ -25,9 +25,7 @@ import (
apimodel "code.superseriousbusiness.org/gotosocial/internal/api/model"
timelinepkg "code.superseriousbusiness.org/gotosocial/internal/cache/timeline"
- "code.superseriousbusiness.org/gotosocial/internal/db"
"code.superseriousbusiness.org/gotosocial/internal/filter/mutes"
- statusfilter "code.superseriousbusiness.org/gotosocial/internal/filter/status"
"code.superseriousbusiness.org/gotosocial/internal/filter/visibility"
"code.superseriousbusiness.org/gotosocial/internal/gtserror"
"code.superseriousbusiness.org/gotosocial/internal/gtsmodel"
@@ -79,18 +77,6 @@ func (p *Processor) getStatusTimeline(
gtserror.WithCode,
) {
var err error
- var filters []*gtsmodel.Filter
-
- if requester != nil {
- // Fetch all filters relevant for requesting account.
- filters, err = p.state.DB.GetFiltersByAccountID(ctx,
- requester.ID,
- )
- if err != nil && !errors.Is(err, db.ErrNoEntries) {
- err := gtserror.Newf("error getting account filters: %w", err)
- return nil, gtserror.NewErrorInternalError(err)
- }
- }
// Ensure we have valid
// input paging cursor.
@@ -135,9 +121,8 @@ func (p *Processor) getStatusTimeline(
status,
requester,
filterCtx,
- filters,
)
- if err != nil && !errors.Is(err, statusfilter.ErrHideStatus) {
+ if err != nil && !errors.Is(err, typeutils.ErrHideStatus) {
return nil, err
}
return apiStatus, nil