From 79ae8c195d88308f7e2ac6d3091555e6145726ce Mon Sep 17 00:00:00 2001 From: zhl Date: Fri, 6 Aug 2021 15:03:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=9A=E6=97=B6=E5=8F=91?= =?UTF-8?q?=E9=80=81=E7=9A=84=E5=AE=9A=E6=97=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api.server.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/api.server.ts b/src/api.server.ts index ff2e24d..2bd6133 100644 --- a/src/api.server.ts +++ b/src/api.server.ts @@ -7,6 +7,7 @@ import logger from 'logger/logger' import config from 'config/config' import { RedisClient } from './redis/RedisClient' import { GameInfoCache } from './cache/GameInfoCache' +import SubscribeSchedule from './schedule/subscribe.schedule' const zReqParserPlugin = require('plugins/zReqParser') @@ -145,6 +146,10 @@ export class ApiServer { await new GameInfoCache().init() } + private async initSchedules() { + await new SubscribeSchedule().scheduleAll() + } + public async start() { let self = this return new Promise(async (resolve, reject) => { @@ -154,6 +159,7 @@ export class ApiServer { self.setErrHandler() self.setFormatSend() await self.initCaches() + await self.initSchedules() this.server.listen({ port: config.api.port }, (err: any, address: any) => { if (err) { logger.log(err)