Attempt aggressive caching

This commit is contained in:
Patrick O'Grady 2020-10-27 22:41:51 -07:00
parent 311eb6988c
commit 46da44d520
No known key found for this signature in database
GPG key ID: 8DE11C985C0C8D85

View file

@ -455,15 +455,11 @@ func (i *Indexer) getCoin(
m, ok := i.coinMap[coinIdentifier.Identifier] m, ok := i.coinMap[coinIdentifier.Identifier]
i.coinMapMutex.RUnlock() i.coinMapMutex.RUnlock()
if ok { if ok {
fmt.Println("used cache", coinIdentifier.Identifier)
return m.Coin, m.Account, nil return m.Coin, m.Account, nil
} }
return i.coinStorage.GetCoinTransactional( // THis is SUPER dangerous (won't survive restart)
ctx, return nil, nil, storage.ErrCoinNotFound
dbTx,
coinIdentifier,
)
} }
func (i *Indexer) findCoin( func (i *Indexer) findCoin(