(fix/desktop) fix sporadic empty community token hodler list (#14057)
This PR fixes #13650 - Reduces the timer for fetching the token hodlers to refresh cashe - Check for temporary contract address before making requests
This commit is contained in:
parent
201a5bfdfc
commit
af6dd257cc
|
@ -323,7 +323,7 @@ QtObject:
|
||||||
result.communityService = communityService
|
result.communityService = communityService
|
||||||
result.currencyService = currencyService
|
result.currencyService = currencyService
|
||||||
result.tokenOwnersTimer = newQTimer()
|
result.tokenOwnersTimer = newQTimer()
|
||||||
result.tokenOwnersTimer.setInterval(10*60*1000)
|
result.tokenOwnersTimer.setInterval(5*60*1000)
|
||||||
signalConnect(result.tokenOwnersTimer, "timeout()", result, "onRefreshTransferableTokenOwners()", 2)
|
signalConnect(result.tokenOwnersTimer, "timeout()", result, "onRefreshTransferableTokenOwners()", 2)
|
||||||
result.tokenOwners1SecTimer = newQTimer()
|
result.tokenOwners1SecTimer = newQTimer()
|
||||||
result.tokenOwners1SecTimer.setInterval(1000)
|
result.tokenOwners1SecTimer.setInterval(1000)
|
||||||
|
@ -1369,7 +1369,13 @@ QtObject:
|
||||||
dataToEmit.requestId = responseJson{"requestId"}.getStr
|
dataToEmit.requestId = responseJson{"requestId"}.getStr
|
||||||
self.events.emit(SIGNAL_COMPUTE_AIRDROP_FEE, dataToEmit)
|
self.events.emit(SIGNAL_COMPUTE_AIRDROP_FEE, dataToEmit)
|
||||||
|
|
||||||
|
proc isTokenDeployed(self: Service, token: CommunityTokenDto): bool =
|
||||||
|
return token.deployState == DeployState.Deployed
|
||||||
|
|
||||||
proc fetchCommunityOwners*(self: Service, communityToken: CommunityTokenDto) =
|
proc fetchCommunityOwners*(self: Service, communityToken: CommunityTokenDto) =
|
||||||
|
if not self.isTokenDeployed(communityToken):
|
||||||
|
return
|
||||||
|
|
||||||
if communityToken.tokenType == TokenType.ERC20:
|
if communityToken.tokenType == TokenType.ERC20:
|
||||||
let arg = FetchAssetOwnersArg(
|
let arg = FetchAssetOwnersArg(
|
||||||
tptr: cast[ByteAddress](fetchAssetOwnersTaskArg),
|
tptr: cast[ByteAddress](fetchAssetOwnersTaskArg),
|
||||||
|
@ -1392,6 +1398,8 @@ QtObject:
|
||||||
)
|
)
|
||||||
self.threadpool.start(arg)
|
self.threadpool.start(arg)
|
||||||
return
|
return
|
||||||
|
else:
|
||||||
|
debug "Unable to fetch token hodlers for token type ", token=communityToken.tokenType
|
||||||
|
|
||||||
proc onCommunityTokenOwnersFetched*(self:Service, response: string) {.slot.} =
|
proc onCommunityTokenOwnersFetched*(self:Service, response: string) {.slot.} =
|
||||||
let responseJson = response.parseJson()
|
let responseJson = response.parseJson()
|
||||||
|
|
Loading…
Reference in New Issue