Skip to content

Add timout for fetching peer id #145

@NikolasHaimerl

Description

@NikolasHaimerl

Add timeout for getIndexProviderPeerId call

Description

We should add a timeout for the getIndexProviderPeerId call in backend/lib/resolve-payload-cids.js, similarly to what we had in the original implementation in spark-checker.

Current Implementation

return await getIndexProviderPeerId(
  `fo${minerId}`,
  smartContract,
  { rpcFn: makeRpcRequest }
)

Background

It seems we didn't configure any timeout in the original implementation in spark-deal-observer. This timeout is necessary to ensure the application doesn't hang indefinitely when making external calls.

Reference

Related to implementation in
#143
CheckerNetwork/spark-checker#129
CheckerNetwork/spark-spot-check#7

Proposed Solution

Add a timeout parameter to the getIndexProviderPeerId call similar to the original implementation in spark-checker.

Changes need to be done in

Metadata

Metadata

Labels

Projects

Status

✅ done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions