summaryrefslogtreecommitdiff
path: root/internal/cache/gts.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-05-01 11:36:46 +0100
committerLibravatar GitHub <noreply@github.com>2023-05-01 12:36:46 +0200
commit3ff1391a9dfaeee4102654a6a871ef843e13b639 (patch)
tree4dbdfadc10f6edb0a8e6eae1a2c6bf49b8c1ca42 /internal/cache/gts.go
parent[chore]: Bump modernc.org/sqlite from 1.22.0 to 1.22.1 (#1726) (diff)
downloadgotosocial-3ff1391a9dfaeee4102654a6a871ef843e13b639.tar.xz
[performance] replace domain block cache with an in-memory radix trie (#1714)
* replace domain block cache with an in-memory radix tree Signed-off-by: kim <grufwub@gmail.com> * fix domain block cache init Signed-off-by: kim <grufwub@gmail.com> --------- Signed-off-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/cache/gts.go')
-rw-r--r--internal/cache/gts.go12
1 files changed, 1 insertions, 11 deletions
diff --git a/internal/cache/gts.go b/internal/cache/gts.go
index a96bc3608..1032a5611 100644
--- a/internal/cache/gts.go
+++ b/internal/cache/gts.go
@@ -72,12 +72,6 @@ func (c *GTSCaches) Init() {
func (c *GTSCaches) Start() {
tryStart(c.account, config.GetCacheGTSAccountSweepFreq())
tryStart(c.block, config.GetCacheGTSBlockSweepFreq())
- tryUntil("starting domain block cache", 5, func() bool {
- if sweep := config.GetCacheGTSDomainBlockSweepFreq(); sweep > 0 {
- return c.domainBlock.Start(sweep)
- }
- return true
- })
tryStart(c.emoji, config.GetCacheGTSEmojiSweepFreq())
tryStart(c.emojiCategory, config.GetCacheGTSEmojiCategorySweepFreq())
tryStart(c.follow, config.GetCacheGTSFollowSweepFreq())
@@ -102,7 +96,6 @@ func (c *GTSCaches) Start() {
func (c *GTSCaches) Stop() {
tryStop(c.account, config.GetCacheGTSAccountSweepFreq())
tryStop(c.block, config.GetCacheGTSBlockSweepFreq())
- tryUntil("stopping domain block cache", 5, c.domainBlock.Stop)
tryStop(c.emoji, config.GetCacheGTSEmojiSweepFreq())
tryStop(c.emojiCategory, config.GetCacheGTSEmojiCategorySweepFreq())
tryStop(c.follow, config.GetCacheGTSFollowSweepFreq())
@@ -233,10 +226,7 @@ func (c *GTSCaches) initBlock() {
}
func (c *GTSCaches) initDomainBlock() {
- c.domainBlock = domain.New(
- config.GetCacheGTSDomainBlockMaxSize(),
- config.GetCacheGTSDomainBlockTTL(),
- )
+ c.domainBlock = new(domain.BlockCache)
}
func (c *GTSCaches) initEmoji() {