feat(gvg): 备战期结束发放未领取邮件

This commit is contained in:
luying
2023-03-07 19:23:37 +08:00
parent 6b79612a5e
commit 129f232e84
8 changed files with 88 additions and 7 deletions

View File

@@ -44,7 +44,7 @@ import { HiddenDataModel, HiddenDataModelType } from '../db/HiddenData';
import { setHiddenData, setHiddenDataToMemory } from './dataService';
import { GVGConfigModel } from '../db/GVGConfig';
import { createNewGVGConfig, initLeaguePrepare } from './gvg/gvgService';
import { getFightTimeByPeriod, saveVestigeRankSchedule } from './gvg/gvgFightService';
import { getFightTimeByPeriod, saveVestigeRankSchedule, sendUngotVestigeReward } from './gvg/gvgFightService';
import { gvgBattleEnd } from './gvg/gvgBattleService';
const PER_SECOND = 1 * 1000;
@@ -925,6 +925,9 @@ export async function initGVGConfigSchedule() {
if(scheduledJobs[`gvgFight`]) scheduledJobs[`gvgFight`].cancel();
scheduleJob(`gvgFight`, '0 0 22 * * ?', saveVestigeRankSchedule);
if(scheduledJobs[`gvgBattle`]) scheduledJobs[`gvgBattle`].cancel();
scheduleJob(`gvgBattle`, config.battleTime * 1000, sendUngotVestigeReward);
let { startFightTime, endFightTime } = getFightTimeByPeriod(GVG_PERIOD.BATTLE, config.battleTime);
if(nowSeconds() > startFightTime - GVG.GVG_GUARD_START_TIME && nowSeconds() < endFightTime) {