diff --git a/auto-bid-tool/models/grays.com/grays-api-bid.js b/auto-bid-tool/models/grays.com/grays-api-bid.js index 765a698..370d69a 100644 --- a/auto-bid-tool/models/grays.com/grays-api-bid.js +++ b/auto-bid-tool/models/grays.com/grays-api-bid.js @@ -15,29 +15,29 @@ export class GrayApiBid extends ApiBid { async polling(page) { try { - // 🔥 Xóa tất cả event chặn request trước khi thêm mới - page.removeAllListeners('request'); - await page.setRequestInterception(true); + // // 🔥 Xóa tất cả event chặn request trước khi thêm mới + // page.removeAllListeners('request'); + // await page.setRequestInterception(true); - page.on('request', (request) => { - if (request.url().includes('api/Notifications/GetOutBidLots')) { - console.log('🚀 Fake response cho request:', request.url()); + // page.on('request', (request) => { + // if (request.url().includes('api/Notifications/GetOutBidLots')) { + // console.log('🚀 Fake response cho request:', request.url()); - const fakeData = fs.readFileSync('./data/fake-out-lots.json', 'utf8'); + // const fakeData = fs.readFileSync('./data/fake-out-lots.json', 'utf8'); - request.respond({ - status: 200, - contentType: 'application/json', - body: fakeData, - }); - } else { - try { - request.continue(); // ⚠️ Chỉ tiếp tục nếu request chưa bị chặn - } catch (error) { - console.error('⚠️ Lỗi khi tiếp tục request:', error.message); - } - } - }); + // request.respond({ + // status: 200, + // contentType: 'application/json', + // body: fakeData, + // }); + // } else { + // try { + // request.continue(); // ⚠️ Chỉ tiếp tục nếu request chưa bị chặn + // } catch (error) { + // console.error('⚠️ Lỗi khi tiếp tục request:', error.message); + // } + // } + // }); console.log('🔄 Starting polling process...');