服务器:修复白名单bug

This commit is contained in:
luying
2022-01-10 18:13:27 +08:00
parent 002ca4f8db
commit 5641d8fdfa
8 changed files with 34 additions and 24 deletions

View File

@@ -437,13 +437,17 @@ export async function initMaintenance(servers?: ServerlistType[]) {
// 设置维护
async function setMaintenance(batchCode: string) {
let { maintenance } = maintenInfos.get(batchCode);
console.log('***** maintenance', maintenance);
let now = nowSeconds();
// 发送消息
if(maintenance.hasNotify && now < maintenance.startTime) {
if(now > maintenance.startTime - 5 * 60) {
maintenanceNotifySchedule(batchCode);
} else {
scheduleJob(`maintenNotify${batchCode}`, maintenance.startTime - 5 * 60, () => {
scheduleJob(`maintenNotify${batchCode}`, (maintenance.startTime - 5 * 60) * 1000, () => {
console.log('******* 通知')
maintenanceNotifySchedule(batchCode);
})
}