refactor: optimize socket connection handling by removing polling transport and implementing lazy connection strategy in SocketManager for improved performance

This commit is contained in:
sebseb7
2025-07-23 07:29:15 +02:00
parent d8f438c3f3
commit bbd1371eb2
44 changed files with 206 additions and 407 deletions

View File

@@ -148,7 +148,7 @@ const renderProductWorker = async (productSeoNames, workerId, progressCallback,
const socketUrl = "http://127.0.0.1:9303";
const workerSocket = io(socketUrl, {
path: "/socket.io/",
transports: ["polling", "websocket"],
transports: ["websocket"],
reconnection: false,
timeout: 10000,
});
@@ -809,7 +809,7 @@ const fetchCategoryDataAndRender = () => {
const socket = io(socketUrl, {
path: "/socket.io/",
transports: ["polling", "websocket"], // Using polling first is more robust
transports: [ "websocket"],
reconnection: false,
timeout: 10000,
});