MCPcopy Create free account
hub / github.com/LagrangeDev/LagrangeGo / GetCachedRkeyInfos

Method GetCachedRkeyInfos

client/cache.go:155–176  ·  view source on GitHub ↗

GetCachedRkeyInfos 获取所有RKey信息(缓存)

()

Source from the content-addressed store, hash-verified

153
154// GetCachedRkeyInfos 获取所有RKey信息(缓存)
155func (c *QQClient) GetCachedRkeyInfos() map[entity.RKeyType]*entity.RKeyInfo {
156 refresh := c.cache.RkeyInfoCacheIsEmpty()
157 for {
158 if refresh {
159 if err := c.RefreshAllRkeyInfoCache(); err != nil {
160 return nil
161 }
162 refresh = false
163 }
164 inf := c.cache.GetAllRkeyInfo()
165 for _, v := range inf {
166 if v.ExpireTime <= uint64(time.Now().Unix()) {
167 refresh = true
168 break
169 }
170 }
171 if refresh {
172 continue
173 }
174 return inf
175 }
176}
177
178// RefreshFriendCache 刷新好友缓存
179func (c *QQClient) RefreshFriendCache() error {

Callers

nothing calls this directly

Calls 3

RkeyInfoCacheIsEmptyMethod · 0.80
GetAllRkeyInfoMethod · 0.80

Tested by

no test coverage detected