Chore: Remove fetching community data (#4794)

This commit is contained in:
Cuteivist 2024-03-13 17:33:01 +01:00 committed by GitHub
parent f69ee07593
commit afd72ace28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 0 additions and 19 deletions

View File

@ -367,7 +367,6 @@ func (r *Reader) getWalletTokenBalances(ctx context.Context, addresses []common.
}
result := make(map[common.Address][]Token)
communities := make(map[string]bool)
dayAgoTimestamp := time.Now().Add(-24 * time.Hour).Unix()
for _, address := range addresses {
@ -434,10 +433,6 @@ func (r *Reader) getWalletTokenBalances(ctx context.Context, addresses []common.
Image: tokens[0].Image,
}
if walletToken.CommunityData != nil {
communities[walletToken.CommunityData.ID] = true
}
result[address] = append(result[address], walletToken)
}
}
@ -445,10 +440,6 @@ func (r *Reader) getWalletTokenBalances(ctx context.Context, addresses []common.
r.lastWalletTokenUpdateTimestamp.Store(time.Now().Unix())
for communityID := range communities {
r.communityManager.FetchCommunityMetadataAsync(communityID)
}
return result, r.persistence.SaveTokens(result)
}
@ -613,8 +604,6 @@ func (r *Reader) GetWalletToken(ctx context.Context, addresses []common.Address)
return nil, err
}
communities := make(map[string]bool)
for address, tokens := range result {
for index, token := range tokens {
marketValuesPerCurrency := make(map[string]TokenMarketValues)
@ -635,10 +624,6 @@ func (r *Reader) GetWalletToken(ctx context.Context, addresses []common.Address)
}
}
if token.CommunityData != nil {
communities[token.CommunityData.ID] = true
}
if _, ok := tokenDetails[token.Symbol]; !ok {
continue
}
@ -652,10 +637,6 @@ func (r *Reader) GetWalletToken(ctx context.Context, addresses []common.Address)
r.lastWalletTokenUpdateTimestamp.Store(time.Now().Unix())
for communityID := range communities {
r.communityManager.FetchCommunityMetadataAsync(communityID)
}
return result, r.persistence.SaveTokens(result)
}