parent
4006cb78b3
commit
d73c886d3b
|
@ -21,6 +21,8 @@ const requestTimeout = 5 * time.Second
|
||||||
|
|
||||||
const hystrixContractOwnershipClientName = "contractOwnershipClient"
|
const hystrixContractOwnershipClientName = "contractOwnershipClient"
|
||||||
|
|
||||||
|
const maxNFTDescriptionLength = 1024
|
||||||
|
|
||||||
type Manager struct {
|
type Manager struct {
|
||||||
rpcClient *rpc.Client
|
rpcClient *rpc.Client
|
||||||
mainContractOwnershipProvider thirdparty.NFTContractOwnershipProvider
|
mainContractOwnershipProvider thirdparty.NFTContractOwnershipProvider
|
||||||
|
@ -272,6 +274,12 @@ func (o *Manager) processAssets(chainID uint64, assets []opensea.Asset) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The NFT description field could be arbitrarily large, causing memory management issues upstream.
|
||||||
|
// Trim it to a reasonable length here.
|
||||||
|
if len(assets[idx].Description) > maxNFTDescriptionLength {
|
||||||
|
assets[idx].Description = assets[idx].Description[:maxNFTDescriptionLength]
|
||||||
|
}
|
||||||
|
|
||||||
o.nftCache[chainID][id.HashKey()] = assets[idx]
|
o.nftCache[chainID][id.HashKey()] = assets[idx]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue