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)