Storage class is now OOP

This commit is contained in:
2025-01-01 21:34:23 +01:00
parent 04e081c31a
commit 5982422e04
15 changed files with 109 additions and 72 deletions

View File

@ -6,7 +6,7 @@ import { Server as SocketServer } from 'socket.io'
import config from '#application/config'
import Logger, { LoggerType } from '#application/logger'
import { getAppPath } from '#application/storage'
import Storage from '#application/storage'
import { TSocket } from '#application/types'
import SocketManager from '#managers/socketManager'
@ -56,9 +56,9 @@ class QueueManager {
const { jobName, params, socketId } = job.data
try {
const jobsDir = getAppPath('jobs')
const jobsDir = Storage.getAppPath('jobs')
const extension = config.ENV === 'development' ? '.ts' : '.js'
const jobPath = getAppPath('jobs', `${jobName}${extension}`)
const jobPath = Storage.getAppPath('jobs', `${jobName}${extension}`)
if (!fs.existsSync(jobPath)) {
this.logger.warn(`Job file not found: ${jobPath}`)