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

Shutdown hook #492

Closed
DimTheo opened this issue Nov 23, 2023 · 2 comments
Closed

Shutdown hook #492

DimTheo opened this issue Nov 23, 2023 · 2 comments

Comments

@DimTheo
Copy link

DimTheo commented Nov 23, 2023

https://github.com/anchan828/nest-redlock/blob/571d91242aea65514d45a05884c162f87987f8b4/packages/redlock/src/redlock.module.ts#L16C1-L34C3

OnModuleDestroy kills the redis clients early, which means any locked resources still running/being processed (like queue messages) will throw The operation was unable to achieve a quorum during its retry window. error.

Changing the code above to use OnApplicationShutdown hook would prevent these kind of issues.

anchan828 added a commit that referenced this issue Nov 23, 2023
fix(#492): use onApplicationShutdown instead of onModuleDestroy
@anchan828
Copy link
Owner

Hi @DimTheo, Thanks for the suggestion. Your suggestion makes sense.
This was changed by this PR and a new version was released. Please try it out.

https://www.npmjs.com/package/@anchan828/nest-redlock/v/0.2.0

@anchan828
Copy link
Owner

If you have any problems, please create another issue.

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

2 participants