interlay / interbtc-squid

Subquid GraphQL schema and indexer for the Interlay and Kintsugi networks
Apache License 2.0
4 stars 7 forks source link

Reduce use of ApiPromise connections, or close after use #135

Closed bvotteler closed 1 year ago

bvotteler commented 1 year ago

Since #129 is not feasible, we want to at least make sure that squid closes the connection again when it uses ApiPromise to fetch foreign asset metadata. Currently, it reconnects every time and might leave the connection dangling.

It would be good if we can reduce the use of ApiPromise to be replaced by using the storage accessor methods for squid (however, squids generic storage accessor does not read entry maps with id and value fields), or use the lib instance.