增加定时发送的定时器

This commit is contained in:
zhl 2021-08-06 15:03:52 +08:00
parent 221fffb169
commit 79ae8c195d

View File

@ -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)