refactor: optimize socket connection handling by removing polling transport and implementing lazy connection strategy in SocketManager for improved performance
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user