Moved more socket logic into socket manager for easier DX

This commit is contained in:
2024-12-30 02:39:31 +01:00
parent a5c941cbb0
commit ba12674e7c
4 changed files with 82 additions and 71 deletions

View File

@ -8,6 +8,7 @@ import config from '#application/config'
import Logger, { LoggerType } from '#application/logger'
import { getAppPath } from '#application/storage'
import { TSocket } from '#application/types'
import SocketManager from '#managers/socketManager'
class QueueManager {
private connection!: IORedis
@ -16,8 +17,8 @@ class QueueManager {
private io!: SocketServer
private logger = Logger.type(LoggerType.QUEUE)
public async boot(io: SocketServer) {
this.io = io
public async boot() {
this.io = SocketManager.getIO()
this.connection = new IORedis(config.REDIS_URL, {
maxRetriesPerRequest: null