mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02: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:
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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user