1
0
forked from noxious/server

Added REDIS_URL to .env.example and use this in queuManager, removed & commented debug code

This commit is contained in:
2024-09-21 22:00:08 +02:00
parent fd8cefd0db
commit 66cbdec5b6
7 changed files with 21 additions and 35 deletions

View File

@ -1,6 +1,7 @@
import IORedis from 'ioredis';
import { Job, Queue, Worker } from 'bullmq'
import CharacterJoin from '../events/zone/characterJoin'
import config from '../utilities/config'
class QueueManager {
private connection!: IORedis;
@ -8,19 +9,21 @@ class QueueManager {
public worker!: Worker;
public boot() {
this.connection = new IORedis('redis://@127.0.0.1:6379/4', {
this.connection = new IORedis(config.REDIS_URL, {
maxRetriesPerRequest: null
});
this.queue = new Queue('myqueue', { connection: this.connection });
this.worker = new Worker('myqueue', async (job: Job)=>{
console.log('hallo')
console.log(job.data);
console.log(job.data.data.classobj);
const test = job.data.data.classobj();
console.log(test);
console.log(job.data);
}, { connection: this.connection, concurrency: 10000 });
// this.queue = new Queue('myqueue', { connection: this.connection });
// this.worker = new Worker('myqueue', async (job: Job)=>{
// console.log('hallo')
// console.log(job.data);
// console.log(job.data.data.classobj);
// const test = job.data.data.classobj();
// console.log(test);
// console.log(job.data);
// }, { connection: this.connection, concurrency: 10000 });
//
console.log('hallo')
}
}