Problem using queues in my NestJS application during deployment

vlab1
TRIAL

10 months ago

I have a NestJS application that uses “@nestjs/bull” queues. The problem is that no new items are added to the queue.

For example, if I call the add method from some part of my application, no item is added to the queue:

this.queueService.add(...); // at this moment the application continues working, but no item is added to the queue

...

add(action: string, data: any): void {

this.queue.add(action, data);

}

”, but if I add async before my add method, and await before this.queue.add await, that code will take forever to execute:

await this.queueService.add(...); // at which point the application hangs

...

async add(action: string, data: any): Promise<void> {

await this.queue.add(action, data);

}

As far as I understand, bull uses wokers to handle tasks in separate processes. And Railway, in turn, does not allow the creation of these processes.

If I am right, is there any solution to this problem? If not, please tell me what the problem is, because in the local environment everything works correctly.

I use a free plan. I have Redis and my NestJS application deployed within my Railway environment.

0 Replies

Problem using queues in my NestJS application during deployment - Railway Help Station