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

Add ability to customize WorkerOptions #146

Merged
merged 1 commit into from
May 26, 2024
Merged

Conversation

Plytas
Copy link
Contributor

@Plytas Plytas commented May 24, 2024

We have found ourselves in the need of specifying maxRetries and backoff globally on a queue basis, similar to how you can do it on Google Cloud Tasks. It makes it more convenient to have these parameters listed in a single place (most likely a config file) than having to implement them in every job and then trying to keep them in sync.

I used a similar approach as it was done in #139 with handler url.
Initially I wanted to use the callback inside getWorkerOptions() of TaskHandler, but that method has not job or task context to get the queue from. Adding IncomingTask argument to the method would introduce a breaking change in case someone has extended `TaskHandler.

@marickvantuil marickvantuil added the safe-to-test Pull request has access to workflow secrets to run tests label May 26, 2024
@marickvantuil marickvantuil merged commit 3494a12 into stackkit:master May 26, 2024
12 of 13 checks passed
@marickvantuil
Copy link
Member

Thanks! Tagged v4.1.0 with this addition!

@illambo
Copy link
Contributor

illambo commented May 26, 2024

Hi, great PR! Just one suggestion, I think missing the readme changes.
Thanks.

@Plytas
Copy link
Contributor Author

Plytas commented May 27, 2024

I knew I missed something 😄

Thanks @marickvantuil for merging this and for updating docs 👍

@illambo
Copy link
Contributor

illambo commented May 27, 2024

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe-to-test Pull request has access to workflow secrets to run tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants