Skip to content

Commit

Permalink
Cache tweaks (#99)
Browse files Browse the repository at this point in the history
* Increase TTL and cache warmer intervals

* Don't delete cache entries prior to no-cache/warm queries
  • Loading branch information
mgdigital authored Jan 7, 2024
1 parent 6358b27 commit b560874
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/database/cache/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func NewDefaultConfig() Config {
return Config{
CacheEnabled: true,
EaserEnabled: true,
Ttl: time.Minute * 20,
Ttl: time.Minute * 60,
MaxKeys: 1000,
}
}
1 change: 0 additions & 1 deletion internal/database/cache/lru.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ type inMemoryCacher struct {
func (c *inMemoryCacher) Get(ctx context.Context, key string) *caches.Query {
m := cacheModeFromContext(ctx)
if m == ModeNoCache || m == ModeWarm {
c.lru.Remove(key)
return nil
}
val, ok := c.lru.Get(key)
Expand Down
2 changes: 1 addition & 1 deletion internal/database/search/warmer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ type Config struct {
func NewDefaultConfig() Config {
return Config{
Enabled: true,
Interval: 10 * time.Minute,
Interval: 50 * time.Minute,
}
}

0 comments on commit b560874

Please sign in to comment.