Skip to content

Commit

Permalink
fix check websockets script
Browse files Browse the repository at this point in the history
  • Loading branch information
Rihyx committed Apr 15, 2024
1 parent c3bf558 commit 4e4d482
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/xcm-wss-endpoints-monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
with:
node-version: 20.x
cache: 'npm'
- uses: oven-sh/setup-bun@v1

- name: Update npm
run: npm i -g npm@9
Expand All @@ -30,4 +31,4 @@ jobs:
run: npm run build

- name: 💻 Run script
run: npx bun ./scripts/check-websockets.ts --slack-wh=${{ secrets.SLACK_WEBHOOK_URL }}
run: bun ./scripts/check-websockets.ts --slack-wh=${{ secrets.SLACK_WEBHOOK_URL }}
4 changes: 3 additions & 1 deletion scripts/check-websockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function procesArgs() {
async function checkWebSocketEndpoints(
endpoints: ChainEndpoint[],
): Promise<{ endpoint: ChainEndpoint; isAlive: boolean }[]> {
console.log('Checking WebSocket endpoints...');
async function checkIsWebSocketAlive({
chainKey,
ws: endpoint,
Expand All @@ -24,7 +25,8 @@ async function checkWebSocketEndpoints(

let isAlive = false;

ws.on('error', (error) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ws.on('error', (error: any) => {
console.error(
`WebSocket ${chainKey} connection to ${endpoint} failed. Error: ${error.message}`,
);
Expand Down

0 comments on commit 4e4d482

Please sign in to comment.