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

allow manual redis connection #708

Merged
merged 1 commit into from Nov 2, 2023

Conversation

billyen2012
Copy link
Contributor

Hey, this is a super awesome queue library.

I'm working on a next.js project and found that whenever I try to build the project, the build process will failed because Queue is try to connect to the redis host for some reasons.

Not sure if it is because the logic of connection to redis host is in the constructor of the Queue, but be able manually connect to redis seems to solve the problem.

So here is the pull request basically allowing user to manual connect to redis by calling queue.connect() after Queue instance is created.

  • test is added and README is updated accordingly;
  • there is also minor code refactor.

Copy link
Collaborator

@compwright compwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this contribution! I think it would be a bit more user-friendly to call the new option autoConnect and default it to true. If you don't want auto connection then you would manually set the option to false and call queue.connect(). Would you make this change for me?

@compwright
Copy link
Collaborator

@billyen2012 also please note the failing CI checks. You need to edit the commit message for all commits on this branch to comply with this standard: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

@billyen2012 billyen2012 force-pushed the allow-manual-connection branch 2 times, most recently from b55330b to b94b43b Compare October 27, 2023 05:23
@billyen2012
Copy link
Contributor Author

Thank you for this contribution! I think it would be a bit more user-friendly to call the new option autoConnect and default it to true. If you don't want auto connection then you would manually set the option to false and call queue.connect(). Would you make this change for me?

Suggested change has been applied

@billyen2012
Copy link
Contributor Author

@billyen2012 also please note the failing CI checks. You need to edit the commit message for all commits on this branch to comply with this standard: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

Opps, I was unaware that I suppose to use npm run ci for all the test.

should be okay now
image

I also notice that sometimes the test will failed because when all the test suite are executed together, it will just make redis dropping connection. Not sure if it was just the issue of my redis, but I will suggest the following change to make the test more stable. (this is not in this PR)

image

@compwright compwright merged commit 425fb89 into bee-queue:master Nov 2, 2023
4 checks passed
beequeueci pushed a commit that referenced this pull request Nov 2, 2023
## [1.6.0](v1.5.0...v1.6.0) (2023-11-02)

### Features

* **queue:** allow manual connection ([#708](#708)) ([425fb89](425fb89))
@beequeueci
Copy link
Collaborator

🎉 This PR is included in version 1.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants