名将擂台:特殊处理已经定时任务处理

This commit is contained in:
luying
2022-07-19 13:05:40 +08:00
parent 05d8449ca3
commit 9a0cdf7204
5 changed files with 21 additions and 18 deletions

View File

@@ -743,6 +743,9 @@ async function setTakeRankSnapshotSchedule(activityId: number, serverId: number,
// —————————————— 名将擂台 start —————————————— //
export async function setLadderCountDown(battleCode: string, time: number, status: LADDER_STATUS) {
if(scheduledJobs[`ladder${battleCode}`]) {
scheduledJobs[`ladder${battleCode}`].cancel();
}
let endTime = time + (status == LADDER_STATUS.CHECK? LADDER.LADDER_BATTLE_PREPARE_COUNTDOWN: LADDER.LADDER_BATTLE_COUNTDOWN) + LADDER_SERVER_GAP_TIME;
scheduleJob(`ladder${battleCode}`, endTime * 1000, async () => {
await ladderTimeout(battleCode, status);