From 4f2aa792b33fdd5fb4b22dec813b3668d7190522 Mon Sep 17 00:00:00 2001 From: kim Date: Tue, 1 Jul 2025 16:00:04 +0200 Subject: [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 Co-committed-by: kim --- internal/processing/conversations/update.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/processing/conversations/update.go') diff --git a/internal/processing/conversations/update.go b/internal/processing/conversations/update.go index e4024a24a..cf81d6906 100644 --- a/internal/processing/conversations/update.go +++ b/internal/processing/conversations/update.go @@ -23,11 +23,11 @@ import ( apimodel "code.superseriousbusiness.org/gotosocial/internal/api/model" "code.superseriousbusiness.org/gotosocial/internal/db" - 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/id" "code.superseriousbusiness.org/gotosocial/internal/log" + "code.superseriousbusiness.org/gotosocial/internal/typeutils" "code.superseriousbusiness.org/gotosocial/internal/util" ) @@ -167,7 +167,7 @@ func (p *Processor) UpdateConversationsForStatus(ctx context.Context, status *gt if err != nil { // If the conversation's last status matched a hide filter, skip it. // If there was another kind of error, log that and skip it anyway. - if !errors.Is(err, statusfilter.ErrHideStatus) { + if !errors.Is(err, typeutils.ErrHideStatus) { log.Errorf(ctx, "error converting conversation %s to API representation for account %s: %v", status.ID, -- cgit v1.2.3