This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
Closing workers #1800
Answered
by
anchan828
nambirajan-goxai
asked this question in
Q&A
Closing workers
#1800
-
Hi , Is there a way to close a worker gracefully ? In bullmq it is done by calling close function through worker object like worker.close() , Is there something similar that can be done using this package ? |
Beta Was this translation helpful? Give feedback.
Answered by
anchan828
Dec 28, 2022
Replies: 1 comment
-
@nambirajan-goxai Hi, You can use import { BullService } from "@anchan828/nest-bullmq";
export class YourService {
constructor(private readonly bullService: BullService) {}
public async closeWorker() {
await this.bullService.workers[`queueName`].close();
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
nambirajan-goxai
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@nambirajan-goxai Hi, You can use
BullService
to terminate queue/worker/event. However, since no care is taken after manual termination, unexpected problems may occur.