GetCachedRkeyInfos 获取所有RKey信息(缓存)
()
| 153 | |
| 154 | // GetCachedRkeyInfos 获取所有RKey信息(缓存) |
| 155 | func (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 刷新好友缓存 |
| 179 | func (c *QQClient) RefreshFriendCache() error { |
nothing calls this directly
no test coverage detected