From 2e1dc29f4e3d150ca8d5d38f7d5421a8305470e7 Mon Sep 17 00:00:00 2001 From: mamengke01 <794347210@qq.com> Date: Wed, 13 Jan 2021 17:21:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=9B=E5=AD=A3=E8=AE=A1=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/timeTaskService.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/game-server/app/services/timeTaskService.ts b/game-server/app/services/timeTaskService.ts index 812db2186..9f2e936d4 100644 --- a/game-server/app/services/timeTaskService.ts +++ b/game-server/app/services/timeTaskService.ts @@ -42,13 +42,13 @@ export async function init() { } } let settleTime = (seasonEndTime - SETTLE_DIFF)* PER_SECOND; - seasonJobId = scheduleJob(settleTime, setPvpSeasonResult); + seasonJobId = scheduleJob(settleTime, setPvpSeasonResult, { name: 'setPvpSeasonResult' }); warJobId = scheduleJob("0 0 0 * * 3", resetPvpWarId); } export async function setPvpSeasonResult(obj:{ name:string, notSetNext?: boolean }) { - console.log('exce setPvpSeasonResult'+ obj.name); - let { seasonNum, seasonEndTime } = await setNextPvpTime(obj.notSetNext); + console.log('exce setPvpSeasonResult'+ obj?.name); + let { seasonNum, seasonEndTime } = await setNextPvpTime(obj?.notSetNext); for (let page = 0; page < 3; page++) { let pvpDefenses = await PvpDefenseModel.getPvpDef(500, page); let addMails = new Array(); @@ -153,7 +153,7 @@ async function setNextPvpTime(notSetNext: boolean) { let seasonEndTime = PVP.PVP_SEASON_DAYS * PER_DAY + getTodayZeroPoint(); let systemConfig = await SystemConfigModel.updateSeason(seasonEndTime); let settleTime = (seasonEndTime - SETTLE_DIFF)* PER_SECOND; - seasonJobId = scheduleJob(settleTime, setPvpSeasonResult); + seasonJobId = scheduleJob(settleTime, setPvpSeasonResult, { name: 'setPvpSeasonResult' }); return systemConfig; } @@ -184,6 +184,6 @@ export async function resetPvpSeasonTime(hour: number) { await SystemConfigModel.updateSystemConfig({ seasonEndTime, seasonNum: seasonNum}); } let settleTime = (seasonEndTime - SETTLE_DIFF)* PER_SECOND; - seasonJobId = scheduleJob(settleTime, setPvpSeasonResult); + seasonJobId = scheduleJob(settleTime, setPvpSeasonResult, { name: 'setPvpSeasonResult' }); return { seasonEndTime, seasonNum }; }