feat: msg rpc local cache

This commit is contained in:
withchao
2024-01-18 15:06:07 +08:00
parent e26a582836
commit 899f1f15a4
6 changed files with 46 additions and 8 deletions
+14 -3
View File
@@ -16,6 +16,7 @@ package config
import (
"bytes"
"time"
"github.com/OpenIMSDK/tools/discoveryregistry"
"gopkg.in/yaml.v3"
@@ -373,9 +374,19 @@ type notification struct {
}
type LocalCache struct {
Topic string `yaml:"topic"`
SlotNum int `yaml:"slotNum"`
SlotSize int `yaml:"slotSize"`
Topic string `yaml:"topic"`
SlotNum int `yaml:"slotNum"`
SlotSize int `yaml:"slotSize"`
SuccessExpire int `yaml:"successExpire"` // second
FailedExpire int `yaml:"failedExpire"` // second
}
func (l LocalCache) Failed() time.Duration {
return time.Second * time.Duration(l.FailedExpire)
}
func (l LocalCache) Success() time.Duration {
return time.Second * time.Duration(l.SuccessExpire)
}
func (l LocalCache) Enable() bool {