1
0
forked from noxious/server

Path fixes for all environments, npm run format, removed redundant imports

This commit is contained in:
2024-10-01 00:10:30 +02:00
parent 4cbd62cbb0
commit ce1708a55e
24 changed files with 82 additions and 87 deletions

View File

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