This commit is contained in:
aozhiwei 2024-06-29 14:27:04 +08:00
parent d6f8ed4836
commit d706ab1384

View File

@ -48,8 +48,15 @@ func (this *cacheMgr) fastGetNft(dto *common.NftDto) {
func (this *cacheMgr) internalGetNft(dto *common.NftDto) {
key := dto.GetKey()
if p, ok := this.nftHash.Load(key); ok {
if q5.GetTickCount() - (*p).refreshTick < 1000 * 15 {
dto.NftCache = *p
} else {
return
}
this.nftHash.Delete(key)
if !f5.IsOnlineEnv() {
f5.GetSysLog().Warning("remove cache %s", dto.TokenId)
}
}
l := f5.AllocLock(key)
defer f5.ReleaseLock(l)
if p, ok := this.nftHash.Load(key); ok {
@ -72,7 +79,6 @@ func (this *cacheMgr) internalGetNft(dto *common.NftDto) {
}
})
}
}
}
func (this *cacheMgr) batchGetNfts(nfts []*common.NftDto) {