mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-25 02:58:26 +08:00
1
This commit is contained in:
parent
ea776efa96
commit
64fbbe0b3d
10
pkg/common/storage/cache/mcache/online.go
vendored
10
pkg/common/storage/cache/mcache/online.go
vendored
@ -7,10 +7,18 @@ import (
|
|||||||
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache"
|
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
globalOnlineCache cache.OnlineCache
|
||||||
|
globalOnlineOnce sync.Once
|
||||||
|
)
|
||||||
|
|
||||||
func NewOnlineCache() cache.OnlineCache {
|
func NewOnlineCache() cache.OnlineCache {
|
||||||
return &onlineCache{
|
globalOnlineOnce.Do(func() {
|
||||||
|
globalOnlineCache = &onlineCache{
|
||||||
user: make(map[string]map[int32]struct{}),
|
user: make(map[string]map[int32]struct{}),
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
return globalOnlineCache
|
||||||
}
|
}
|
||||||
|
|
||||||
type onlineCache struct {
|
type onlineCache struct {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user