1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-16 04:24:56 +02:00

app/abi/manager.go: its probably a good thing (tm) to set a context timout when getting the abi from the api.

This commit is contained in:
Henrik Hautakoski 2023-12-06 15:32:33 +01:00
parent 7b1b500b22
commit eeab11c44b

View file

@ -45,7 +45,9 @@ func (mgr *AbiManager) GetAbi(account eos.AccountName) (*eos.ABI, error) {
abi, err := mgr.cache.Get(key)
if err != nil {
resp, err := mgr.api.GetABI(mgr.ctx, account)
ctx, cancel := context.WithTimeout(mgr.ctx, time.Second)
defer cancel()
resp, err := mgr.api.GetABI(ctx, account)
if err != nil {
return nil, fmt.Errorf("api: %s", err)
}