Skip to content

Commit bf18253

Browse files
fix(pyth-lazer-sdk): clear timeout on shutdown (#2263)
* fix(pyth-lazer-sdk): clear timeout on shutdown * update pnpm in ci
1 parent b5510ea commit bf18253

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.github/workflows/ci-lazer-solana-contract.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Install Anchor
3838
run: RUSTFLAGS= cargo install --git https://github.com/coral-xyz/anchor --tag v0.30.1 anchor-cli
3939
- name: Install pnpm
40-
run: npm install --global pnpm@9.13.2
40+
run: npm install --global pnpm@9.15.4
4141
- name: Install test dependencies
4242
run: pnpm install --frozen-lockfile
4343
- name: Run tests

lazer/sdk/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythnetwork/pyth-lazer-sdk",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "Pyth Lazer SDK",
55
"publishConfig": {
66
"access": "public"

lazer/sdk/js/src/socket/websocket-pool.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export class WebSocketPool {
1414
private messageListeners: ((event: WebSocket.Data) => void)[];
1515
private allConnectionsDownListeners: (() => void)[];
1616
private wasAllDown = true;
17+
private checkConnectionStatesInterval: NodeJS.Timeout;
1718

1819
private constructor(private readonly logger: Logger = dummyLogger) {
1920
this.rwsPool = [];
@@ -23,7 +24,7 @@ export class WebSocketPool {
2324
this.allConnectionsDownListeners = [];
2425

2526
// Start monitoring connection states
26-
setInterval(() => {
27+
this.checkConnectionStatesInterval = setInterval(() => {
2728
this.checkConnectionStates();
2829
}, 100);
2930
}
@@ -218,5 +219,6 @@ export class WebSocketPool {
218219
this.subscriptions.clear();
219220
this.messageListeners = [];
220221
this.allConnectionsDownListeners = [];
222+
clearInterval(this.checkConnectionStatesInterval);
221223
}
222224
}

0 commit comments

Comments
 (0)