Skip to content

Commit d7df83d

Browse files
committed
feat: export SessionRecoveryHook type for improved session recovery handling
1 parent 6267bef commit d7df83d

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

nodejs/src/client/wsClient.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import JSONBig from "json-bigint";
22
import { WebSocketConnector } from "./wsConnector";
3+
import type { SessionRecoveryHook } from "./wsConnector";
34
import { WebSocketConnectionPool } from "./wsConnectorPool";
45
import { Dsn, WS_SQL_ENDPOINT } from "../common/dsn";
56
import {
@@ -22,8 +23,6 @@ import {
2223
TSDB_OPTION_CONNECTION,
2324
} from "../common/constant";
2425

25-
type SessionRecoveryHook = () => Promise<void>;
26-
2726
export class WsClient {
2827
private _wsConnector?: WebSocketConnector;
2928
private _timeout?: number | undefined | null;

nodejs/src/client/wsConnector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class InflightRequestStore {
5959
}
6060
}
6161

62-
type SessionRecoveryHook = () => Promise<void>;
62+
export type SessionRecoveryHook = () => Promise<void>;
6363

6464
const RETRIABLE_ACTIONS = new Set(["insert", "options_connection", "poll", "subscribe"]);
6565
// TDengine websocket binary op codes that are safe to replay after reconnect.

0 commit comments

Comments
 (0)