diff --git a/auto-bid-tool/index.js b/auto-bid-tool/index.js index c7573ee..fe762b7 100644 --- a/auto-bid-tool/index.js +++ b/auto-bid-tool/index.js @@ -25,6 +25,8 @@ let MANAGER_BIDS = []; const activeTasks = new Set(); +let timeToUpdateLogin = new Date().toUTCString(); + const handleUpdateProductTabs = (data) => { if (!Array.isArray(data)) { console.log("Data must be array"); @@ -404,6 +406,8 @@ const trackingLoginStatus = async () => { const results = await Promise.allSettled( MANAGER_BIDS.map(async (item) => { try { + if (!isTimeReached(timeToUpdateLogin)) return; + const login_status = await item.isLogin(); await updateLoginStatus({ @@ -414,6 +418,18 @@ const trackingLoginStatus = async () => { }, login_status, }); + + console.log( + "%cindex.js:422 ehehehehehe", + "color: #007acc;", + "ehehehehehe" + ); + + // Set time to update login sau 1 phút + const now = new Date(); + const oneMinuteLater = new Date(now.getTime() + 60 * 1000); + + timeToUpdateLogin = oneMinuteLater; } catch (err) { console.warn( `[⚠️ WARN] Failed to check login for bid ${