Skip to content

Commit

Permalink
fix: Ensure array is returned to Promise.all (#504)
Browse files Browse the repository at this point in the history
`fetchShardsPromises` is used within `Promise.all` to fetch all shards
simultaneously. The `async` modifier means this function returns a
`Promise`. `Promise.all` complains since it's passed a `Promise` rather
than an `Array`.

This PR removes the unnecessary `async` modifier so it works with
`Promise.all`
  • Loading branch information
morgsmccauley authored Jan 16, 2024
1 parent c4f47bf commit 13f7094
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block-server/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const fetchStreamerMessage = async function(block_height, options) {
};
}

const fetchShardsPromises = async function(block_height, number_of_shards, options) {
const fetchShardsPromises = function(block_height, number_of_shards, options) {
return ([...Array(number_of_shards).keys()].map((shard_id) =>
fetchShardPromise(block_height, shard_id, options)));
}
Expand Down

0 comments on commit 13f7094

Please sign in to comment.