From e109c6fbe6342701abb34b6d13d1dc880448b095 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sun, 16 Jun 2024 14:19:59 +0800 Subject: [PATCH] 1 --- server/marketserver/cache/cachemgr.go | 7 +++---- third_party/f5 | 2 +- third_party/q5 | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/server/marketserver/cache/cachemgr.go b/server/marketserver/cache/cachemgr.go index f7c7e2a5..e96d73a6 100644 --- a/server/marketserver/cache/cachemgr.go +++ b/server/marketserver/cache/cachemgr.go @@ -4,13 +4,12 @@ import ( "q5" "f5" "mt" - "sync" "fmt" "main/common" ) type cacheMgr struct { - nftHash sync.Map //net_id contract_address token_id -> nft + nftHash *q5.ConcurrentMap[string, *nft] //net_id contract_address token_id -> nft } func (this *cacheMgr) Init() { @@ -30,12 +29,12 @@ func (this *cacheMgr) GetNfts(nfts []*common.NftDto) { func (this *cacheMgr) internalGetNft(dto *common.NftDto) { key := fmt.Sprintf("%d_%s_%s", dto.NetId, dto.ContractAddress, dto.TokenId) if p, ok := this.nftHash.Load(key); ok { - dto.NftCache = p.(*nft) + dto.NftCache = *p } else { l := f5.AllocLock(key) defer f5.ReleaseLock(l) if p, ok := this.nftHash.Load(key); ok { - dto.NftCache = p.(*nft) + dto.NftCache = *p } else { f5.GetHttpCliMgr().SendGoStyleRequest( mt.Table.Config.GetGameApiUrl() + "/webapp/index.php", diff --git a/third_party/f5 b/third_party/f5 index ee715d67..550a6438 160000 --- a/third_party/f5 +++ b/third_party/f5 @@ -1 +1 @@ -Subproject commit ee715d672d83932a6a20f810cc490d737fad01e6 +Subproject commit 550a64387e2d163b99ea39bbf48500bba998676e diff --git a/third_party/q5 b/third_party/q5 index 9048589a..47f75d82 160000 --- a/third_party/q5 +++ b/third_party/q5 @@ -1 +1 @@ -Subproject commit 9048589a4ddb6d7432350a2030f8445b9fac7d83 +Subproject commit 47f75d8247df848d50ba0e763c41dd6554a8b758