added more tuning knobs, particularly in cache sizes

This commit is contained in:
2026-02-20 15:44:06 -07:00
parent d8eeeb7140
commit 8a1c770079
10 changed files with 86 additions and 34 deletions
+4 -3
View File
@@ -18,6 +18,7 @@ import (
"sync"
"time"
"git.erbosoft.com/amy/amsterdam/config"
lru "github.com/hashicorp/golang-lru"
)
@@ -236,10 +237,10 @@ var contactCache *lru.TwoQueueCache = nil
// getContactMutex is a mutex on AmGetContactInfo.
var getContactMutex sync.Mutex
// init initializes the contact info cache.
func init() {
// setupContactsCache initializes the contact info cache.
func setupContactsCache() {
var err error
contactCache, err = lru.New2Q(100)
contactCache, err = lru.New2Q(config.GlobalConfig.Tuning.Caches.ContactInfo)
if err != nil {
panic(err)
}