Skip to content

Commit f034fdf

Browse files
author
Andrea Cosentino
committed
fix: onping ws handler
1 parent 481c9d7 commit f034fdf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/utils/plugin.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ async function handlingApiFsRequest(logger: ILogger, fullUrl: URL, request: Univ
9090
return false;
9191
}
9292
}
93-
handler === null && logger.info("Request handling with FS API");
93+
handler === null && logger.debug("Request handling with FS API");
9494
const dataFile: { originalData: any, data: any, mimeType: string, total: number } = {
9595
total: 0,
9696
data: null,
@@ -882,7 +882,9 @@ export const runWsPlugin = (server: ViteDevServer | PreviewServer, logger: ILogg
882882
});
883883

884884
ws.on("ping", async (data: Buffer) => {
885-
connection.resetMissedPong();
885+
if (currentHandler.inactivityTimeout && currentHandler.inactivityTimeout > 0) {
886+
connection.resetInactivityTimer(currentHandler.inactivityTimeout);
887+
}
886888
if (currentHandler.onPing) {
887889
try {
888890
await currentHandler.onPing(connection, data);

0 commit comments

Comments
 (0)