✨ feat(gvg): 添加组建期邮件、添加自动解散定时任务
This commit is contained in:
@@ -11,6 +11,7 @@ import { getRandSingleEelm } from "../../pubUtils/util";
|
||||
import { GVG } from "../../pubUtils/dicParam";
|
||||
import { ServerlistModel } from "../../db/Serverlist";
|
||||
import { GuildModel, GuildType } from "../../db/Guild";
|
||||
import { checkHasCities } from "./gvgBattleService";
|
||||
|
||||
// 定时器相关
|
||||
export async function createNewGVGConfig() {
|
||||
@@ -24,7 +25,13 @@ export async function createNewGVGConfig() {
|
||||
} catch(e) {
|
||||
console.log('remote未初始完');
|
||||
}
|
||||
// TODO 每周自动解散一些联军
|
||||
// 每周自动解散一些联军
|
||||
let autoLeagues = await GVGLeagueModel.findAutoCreateLeague();
|
||||
let needDissmissLeagueId: string[] = [];
|
||||
for(let league of autoLeagues) {
|
||||
if(!await checkHasCities(league)) needDissmissLeagueId.push(league._id);
|
||||
}
|
||||
await GVGLeagueModel.dismissByIds(needDissmissLeagueId);
|
||||
return config;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user