Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we make queue.close() quick? #1294

Closed
snawaz opened this issue Jun 24, 2022 · 2 comments
Closed

Can we make queue.close() quick? #1294

snawaz opened this issue Jun 24, 2022 · 2 comments

Comments

@snawaz
Copy link
Contributor

snawaz commented Jun 24, 2022

Currently, the queue.close() takes almost 0.5s to close, because close() eventually calls waitForJob which delay() for 100ms currently (and that's being multiplied, eventually .close() becoming 0.5s slow).

Anyway, if close() has been called, can we detect this scenario and then avoid calling delay() in that case? Or maybe some better solution.. 🤔

} catch (error) {
if (isNotConnectionError(<Error>error)) {
this.emit('error', <Error>error);
}
await this.delay();
} finally {

In the catch block, the error is: Error: Connection is closed (I just added the log to see it).

Two weeks back I faced a similar issue with the bull library. However, now I've switched to bullmq. Lots of the implementation I see is very similar. So maybe the other thread would be helpful as well, so here it is: OptimalBits/bull#2372

@snawaz
Copy link
Contributor Author

snawaz commented Jun 25, 2022

PR created: #1295

@snawaz
Copy link
Contributor Author

snawaz commented Jun 26, 2022

Closed via #1295

@snawaz snawaz closed this as completed Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant