Skip to content

Commit

Permalink
await sleep to respect request rate limiting (#3660)
Browse files Browse the repository at this point in the history
  • Loading branch information
akuzni2 authored Jan 28, 2025
1 parent fae9387 commit 9497aa6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/green-buses-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chainlink/elwood-adapter': patch
---

Await sleep command
2 changes: 1 addition & 1 deletion packages/sources/elwood/src/transport/crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export const transport: WebSocketTransport<WsTransportTypes> =
})

if (messages.length > 1) {
sleep(context.adapterSettings.SUBSCRIBE_DELAY_MS || 0)
await sleep(context.adapterSettings.SUBSCRIBE_DELAY_MS || 0)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/sources/elwood/src/transport/lwba.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const transport: WebSocketTransport<WsTransportTypes> =
})

if (messages.length > 1) {
sleep(context.adapterSettings.SUBSCRIBE_DELAY_MS || 0)
await sleep(context.adapterSettings.SUBSCRIBE_DELAY_MS || 0)
}
}
}
Expand Down

0 comments on commit 9497aa6

Please sign in to comment.