forked from noxious/server
Path fixes for all environments, npm run format, removed redundant imports
This commit is contained in:
@ -5,7 +5,7 @@ import { Server as SocketServer } from 'socket.io'
|
||||
import { TSocket } from '../utilities/types'
|
||||
import { queueLogger } from '../utilities/logger'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import { getAppPath } from '../utilities/utilities'
|
||||
|
||||
class QueueManager {
|
||||
private connection!: IORedis
|
||||
@ -52,9 +52,9 @@ class QueueManager {
|
||||
const { jobName, params, socketId } = job.data
|
||||
|
||||
try {
|
||||
const jobsDir = path.join(process.cwd(), 'jobs')
|
||||
const jobsDir = getAppPath('jobs')
|
||||
const extension = config.ENV === 'development' ? '.ts' : '.js'
|
||||
const jobPath = path.join(jobsDir, `${jobName}${extension}`)
|
||||
const jobPath = getAppPath('jobs', `${jobName}${extension}`)
|
||||
|
||||
if (!fs.existsSync(jobPath)) {
|
||||
queueLogger.warn(`Job file not found: ${jobPath}`)
|
||||
|
Reference in New Issue
Block a user