From 0b2ef0c8889246a41284a9932f9706b8d0d2dd6c Mon Sep 17 00:00:00 2001 From: Lei OT Date: Fri, 6 Sep 2024 16:22:54 +0800 Subject: [PATCH] =?UTF-8?q?conf:=20=E8=B0=83=E6=95=B4=20Jobs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/jobs/syncHeytripJobs.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/server/jobs/syncHeytripJobs.js b/server/jobs/syncHeytripJobs.js index cbba6c0..8789176 100644 --- a/server/jobs/syncHeytripJobs.js +++ b/server/jobs/syncHeytripJobs.js @@ -44,6 +44,7 @@ const Aids = () => { */ const AidsState = () => { const dailyJob = scheduleJob('0 0 0 * * *', async function () { + // const dailyJob = scheduleJob('0 20 9 * * *', async function () { const jobAS = scheduleJob('*/2 * * * * *', async function () { console.log('--------------------syncing heytrip, get available accommodation ids.--------------------'); const isRunning = jobAS.pendingInvocations[0]?.job?.running == 1; @@ -64,14 +65,15 @@ const AidsState = () => { /** * 获取新增的酒店详情 - * ID同步结束后启动, ID大约需要3小时 + * ID同步结束后启动, ID每10W 条大约需要半小时 * 每天03:05:00启动 */ const newHotelDetails = () => { // return false; const dailyJob1 = scheduleJob('0 5 3 * * *', async function () { + // const dailyJob1 = scheduleJob('0 5 12 * * *', async function () { const job1 = scheduleJob('*/5 * * * * *', async function () { - console.log('-------------------------syncing heytrip, get accommodation details.-------------------------'); + console.log('-------------------------syncing heytrip[newHotelDetails], get accommodation details.-------------------------'); const isRunning = job1.pendingInvocations[0]?.job?.running == 1; if (!isRunning) { @@ -99,7 +101,7 @@ const hotelLgcDetails = () => { // return false; const dailyJob2 = scheduleJob('0 5 20 * * 5', async function () { const job2 = scheduleJob('*/5 * * * * *', async function () { - console.log('-------------------------syncing heytrip, get accommodation details.-------------------------'); + console.log('-------------------------syncing heytrip[hotelLgcDetails], get accommodation details.-------------------------'); const isRunning = job2.pendingInvocations[0]?.job?.running == 1; if (!isRunning) { @@ -127,7 +129,7 @@ const chinaHotelDetails = () => { // return false; const dailyJobCN = scheduleJob('0 5 20 * * 6', async function () { const job3 = scheduleJob('*/4 * * * * *', async function () { - console.log('-------------------------syncing heytrip, get china accommodation details.-------------------------'); + console.log('-------------------------syncing heytrip[chinaHotelDetails], get china accommodation details.-------------------------'); const isRunning = job3.pendingInvocations[0]?.job?.running == 1; if (!isRunning) { const res = await heytripService.chinaHotelsLgc2('2'); @@ -138,7 +140,7 @@ const chinaHotelDetails = () => { // job3.reschedule('0 0 0 * * *'); } } else { - console.log('pre job running! cancelNext'); + console.log('pre job running! cancelNext[chinaHotelDetails]'); job3.cancelNext(); } });