diff options
| author | 2025-07-01 16:00:04 +0200 | |
|---|---|---|
| committer | 2025-07-01 16:00:04 +0200 | |
| commit | 4f2aa792b33fdd5fb4b22dec813b3668d7190522 (patch) | |
| tree | 1148a9322d04bf43c1c159df3079fb1790c5c154 /internal/processing/filters/v1 | |
| parent | [chore] update go dependencies (#4304) (diff) | |
| download | gotosocial-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/filters/v1')
| -rw-r--r-- | internal/processing/filters/v1/create.go | 4 | ||||
| -rw-r--r-- | internal/processing/filters/v1/delete.go | 4 | ||||
| -rw-r--r-- | internal/processing/filters/v1/filters.go | 5 | ||||
| -rw-r--r-- | internal/processing/filters/v1/update.go | 4 |
4 files changed, 7 insertions, 10 deletions
diff --git a/internal/processing/filters/v1/create.go b/internal/processing/filters/v1/create.go index b2ec69442..9f3fc17e0 100644 --- a/internal/processing/filters/v1/create.go +++ b/internal/processing/filters/v1/create.go @@ -91,8 +91,8 @@ func (p *Processor) Create(ctx context.Context, requester *gtsmodel.Account, for return nil, gtserror.NewErrorInternalError(err) } - // Stream a filters changed event to WS. - p.stream.FiltersChanged(ctx, requester) + // Handle filter change side-effects. + p.c.OnFilterChanged(ctx, requester) // Return as converted frontend filter keyword model. return typeutils.FilterKeywordToAPIFilterV1(filter, filterKeyword), nil diff --git a/internal/processing/filters/v1/delete.go b/internal/processing/filters/v1/delete.go index cab8b185d..65768140a 100644 --- a/internal/processing/filters/v1/delete.go +++ b/internal/processing/filters/v1/delete.go @@ -63,8 +63,8 @@ func (p *Processor) Delete( } } - // Stream a filters changed event to WS. - p.stream.FiltersChanged(ctx, requester) + // Handle filter change side-effects. + p.c.OnFilterChanged(ctx, requester) return nil } diff --git a/internal/processing/filters/v1/filters.go b/internal/processing/filters/v1/filters.go index bcbbd70c0..4492b4e76 100644 --- a/internal/processing/filters/v1/filters.go +++ b/internal/processing/filters/v1/filters.go @@ -19,7 +19,6 @@ package v1 import ( "code.superseriousbusiness.org/gotosocial/internal/processing/filters/common" - "code.superseriousbusiness.org/gotosocial/internal/processing/stream" "code.superseriousbusiness.org/gotosocial/internal/state" "code.superseriousbusiness.org/gotosocial/internal/typeutils" ) @@ -30,15 +29,13 @@ type Processor struct { state *state.State converter *typeutils.Converter - stream *stream.Processor } -func New(state *state.State, converter *typeutils.Converter, common *common.Processor, stream *stream.Processor) Processor { +func New(state *state.State, converter *typeutils.Converter, common *common.Processor) Processor { return Processor{ c: common, state: state, converter: converter, - stream: stream, } } diff --git a/internal/processing/filters/v1/update.go b/internal/processing/filters/v1/update.go index 7e25e6fde..19699f328 100644 --- a/internal/processing/filters/v1/update.go +++ b/internal/processing/filters/v1/update.go @@ -166,8 +166,8 @@ func (p *Processor) Update( return nil, gtserror.NewErrorInternalError(err) } - // Stream a filters changed event to WS. - p.stream.FiltersChanged(ctx, requester) + // Handle filter change side-effects. + p.c.OnFilterChanged(ctx, requester) // Return as converted frontend filter keyword model. return typeutils.FilterKeywordToAPIFilterV1(filter, filterKeyword), nil |
