mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 07:22:24 -05:00
[performance] cache v2 filter keyword regular expressions (#2903)
* add caching of filterkeyword regular expressions * formatting * fix WholeWord nil check
This commit is contained in:
parent
6c0d93c6cb
commit
b092da6d28
5 changed files with 85 additions and 36 deletions
5
internal/cache/db.go
vendored
5
internal/cache/db.go
vendored
|
|
@ -531,6 +531,11 @@ func (c *Caches) initFilterKeyword() {
|
|||
// See internal/db/bundb/filter.go.
|
||||
filterKeyword2.Filter = nil
|
||||
|
||||
// We specifically DO NOT unset
|
||||
// the regexp field here, as any
|
||||
// regexp.Regexp instance is safe
|
||||
// for concurrent access.
|
||||
|
||||
return filterKeyword2
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue