summaryrefslogtreecommitdiff
path: root/internal/cache/cache.go
diff options
context:
space:
mode:
authorLibravatar Vyr Cossont <VyrCossont@users.noreply.github.com>2024-06-06 09:38:02 -0700
committerLibravatar GitHub <noreply@github.com>2024-06-06 16:38:02 +0000
commit5e2d4fdb19eb4fcd4c0bbfb3e2f29067a58c88c8 (patch)
tree607006af6b4bb63bb625b39f3ca0fe869eb6ba95 /internal/cache/cache.go
parent[bugfix] update media if more than just url changes (#2970) (diff)
downloadgotosocial-5e2d4fdb19eb4fcd4c0bbfb3e2f29067a58c88c8.tar.xz
[feature] User muting (#2960)
* User muting * Address review feedback * Rename uniqueness constraint on user_mutes to match convention * Remove unused account_id from where clause * Add UserMute to NewTestDB * Update test/envparsing.sh with new and fixed cache stuff * Address tobi's review comments * Make compiledUserMuteListEntry.expired consistent with UserMute.Expired * Make sure mute_expires_at is serialized as an explicit null for indefinite mutes --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Diffstat (limited to 'internal/cache/cache.go')
-rw-r--r--internal/cache/cache.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/cache/cache.go b/internal/cache/cache.go
index 2af5e20ca..bb910f3e6 100644
--- a/internal/cache/cache.go
+++ b/internal/cache/cache.go
@@ -94,6 +94,8 @@ func (c *Caches) Init() {
c.initToken()
c.initTombstone()
c.initUser()
+ c.initUserMute()
+ c.initUserMuteIDs()
c.initWebfinger()
c.initVisibility()
}
@@ -164,5 +166,7 @@ func (c *Caches) Sweep(threshold float64) {
c.GTS.Token.Trim(threshold)
c.GTS.Tombstone.Trim(threshold)
c.GTS.User.Trim(threshold)
+ c.GTS.UserMute.Trim(threshold)
+ c.GTS.UserMuteIDs.Trim(threshold)
c.Visibility.Trim(threshold)
}