Skip to content

Commit

Permalink
reduce calls at same time to RPC (#138)
Browse files Browse the repository at this point in the history
* reduce calls at same time to RPC

* bump and make a release
  • Loading branch information
ngmachado authored May 24, 2022
1 parent 48c5a0f commit 33c0cd1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "superfluid-sentinel",
"version": "0.9.7",
"version": "0.9.8",
"description": "Superfluid Sentinel",
"main": "main.js",
"scripts": {
Expand Down
7 changes: 3 additions & 4 deletions src/web3client/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,9 @@ class Client {
};
}
const superTokensDB = await this.app.db.models.SuperTokenModel.findAll(filter);
const promises = superTokensDB.map(async (token) => {
return this.loadSuperToken(token.address);
});
await Promise.all(promises);
for(const token of superTokensDB) {
await this.loadSuperToken(token.address);
}
} catch (err) {
this.app.logger.error(err);
throw new Error(`Client._loadSuperTokensFromDB(): ${err}`);
Expand Down

0 comments on commit 33c0cd1

Please sign in to comment.