updated cache
This commit is contained in:
14
util/cache/structs.go
vendored
14
util/cache/structs.go
vendored
@@ -2,15 +2,15 @@ package cache
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
)
|
||||
|
||||
type ShardedCache struct {
|
||||
shards []*shard
|
||||
shardMask uint32
|
||||
type Cache struct {
|
||||
mu sync.Mutex
|
||||
state atomic.Pointer[mappings]
|
||||
}
|
||||
|
||||
type shard struct {
|
||||
mu sync.RWMutex
|
||||
s2c map[string]string // serverId -> channelId
|
||||
c2s map[string]string // channelId -> serverId
|
||||
type mappings struct {
|
||||
s2c map[string]string
|
||||
c2s map[string]string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user