summaryrefslogtreecommitdiff
path: root/internal/processing/common
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/common
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/common')
-rw-r--r--internal/processing/common/status.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/internal/processing/common/status.go b/internal/processing/common/status.go
index 83acddc84..f5f230e98 100644
--- a/internal/processing/common/status.go
+++ b/internal/processing/common/status.go
@@ -24,10 +24,10 @@ import (
apimodel "code.superseriousbusiness.org/gotosocial/internal/api/model"
"code.superseriousbusiness.org/gotosocial/internal/db"
"code.superseriousbusiness.org/gotosocial/internal/federation/dereferencing"
- statusfilter "code.superseriousbusiness.org/gotosocial/internal/filter/status"
"code.superseriousbusiness.org/gotosocial/internal/gtserror"
"code.superseriousbusiness.org/gotosocial/internal/gtsmodel"
"code.superseriousbusiness.org/gotosocial/internal/log"
+ "code.superseriousbusiness.org/gotosocial/internal/typeutils"
)
// GetOwnStatus fetches the given status with ID,
@@ -214,7 +214,6 @@ func (p *Processor) GetAPIStatus(
target,
requester,
gtsmodel.FilterContextNone,
- nil,
)
if err != nil {
err := gtserror.Newf("error converting: %w", err)
@@ -235,7 +234,6 @@ func (p *Processor) GetVisibleAPIStatuses(
requester *gtsmodel.Account,
statuses []*gtsmodel.Status,
filterCtx gtsmodel.FilterContext,
- filters []*gtsmodel.Filter,
) []apimodel.Status {
// Start new log entry with
@@ -278,9 +276,8 @@ func (p *Processor) GetVisibleAPIStatuses(
status,
requester,
filterCtx,
- filters,
)
- if err != nil && !errors.Is(err, statusfilter.ErrHideStatus) {
+ if err != nil && !errors.Is(err, typeutils.ErrHideStatus) {
l.Errorf("error converting: %v", err)
continue
}