增加定时发送的定时器
This commit is contained in:
parent
221fffb169
commit
79ae8c195d
@ -7,6 +7,7 @@ import logger from 'logger/logger'
|
|||||||
import config from 'config/config'
|
import config from 'config/config'
|
||||||
import { RedisClient } from './redis/RedisClient'
|
import { RedisClient } from './redis/RedisClient'
|
||||||
import { GameInfoCache } from './cache/GameInfoCache'
|
import { GameInfoCache } from './cache/GameInfoCache'
|
||||||
|
import SubscribeSchedule from './schedule/subscribe.schedule'
|
||||||
|
|
||||||
const zReqParserPlugin = require('plugins/zReqParser')
|
const zReqParserPlugin = require('plugins/zReqParser')
|
||||||
|
|
||||||
@ -145,6 +146,10 @@ export class ApiServer {
|
|||||||
await new GameInfoCache().init()
|
await new GameInfoCache().init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async initSchedules() {
|
||||||
|
await new SubscribeSchedule().scheduleAll()
|
||||||
|
}
|
||||||
|
|
||||||
public async start() {
|
public async start() {
|
||||||
let self = this
|
let self = this
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
@ -154,6 +159,7 @@ export class ApiServer {
|
|||||||
self.setErrHandler()
|
self.setErrHandler()
|
||||||
self.setFormatSend()
|
self.setFormatSend()
|
||||||
await self.initCaches()
|
await self.initCaches()
|
||||||
|
await self.initSchedules()
|
||||||
this.server.listen({ port: config.api.port }, (err: any, address: any) => {
|
this.server.listen({ port: config.api.port }, (err: any, address: any) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
logger.log(err)
|
logger.log(err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user