refactor: Centralize Socket.IO client options in config for improved maintainability and consistency across prerender scripts
This commit is contained in:
@@ -166,12 +166,7 @@ const NotFound404 = require("./src/pages/NotFound404.js").default;
|
||||
// Worker function for parallel product rendering
|
||||
const renderProductWorker = async (productSeoNames, workerId, progressCallback, categoryMap = {}) => {
|
||||
const socketUrl = "http://127.0.0.1:9303";
|
||||
const workerSocket = io(socketUrl, {
|
||||
path: "/socket.io/",
|
||||
transports: ["websocket"],
|
||||
reconnection: false,
|
||||
timeout: 10000,
|
||||
});
|
||||
const workerSocket = io(socketUrl, config.socketIoClientOptions);
|
||||
|
||||
return new Promise((resolve) => {
|
||||
let processedCount = 0;
|
||||
@@ -863,12 +858,7 @@ const fetchCategoryDataAndRender = () => {
|
||||
process.exit(1);
|
||||
}, 15000);
|
||||
|
||||
const socket = io(socketUrl, {
|
||||
path: "/socket.io/",
|
||||
transports: ["websocket"],
|
||||
reconnection: false,
|
||||
timeout: 10000,
|
||||
});
|
||||
const socket = io(socketUrl, config.socketIoClientOptions);
|
||||
|
||||
socket.on("connect", () => {
|
||||
console.log('Socket connected. Emitting "categoryList"...');
|
||||
|
||||
Reference in New Issue
Block a user