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

Prepare for Sidekiq v7 #707

Merged
merged 2 commits into from
Apr 23, 2022
Merged

Prepare for Sidekiq v7 #707

merged 2 commits into from
Apr 23, 2022

Conversation

mhenrixon
Copy link
Owner

@mhenrixon mhenrixon commented Apr 23, 2022

It seems they are replacing all usage of workers with jobs. Let's do the same in this repo to stay consistent with the newer Sidekiq.

Closes #705

It seems they are replacing all usage of worker with job. Let's do the same in this repo to stay consistent with newer Sidekiq.
@mhenrixon mhenrixon merged commit aa9fb43 into main Apr 23, 2022
@delete-merged-branch delete-merged-branch bot deleted the feature/sidekiq-v7 branch April 23, 2022 09:43
adamcreekroad added a commit to adamcreekroad/sidekiq-unique-jobs that referenced this pull request Oct 26, 2022
BACKGROUND -------------------------------------------------------------

mhenrixon#707 introduced a regression where the instance level `after_unlock`
callback is no longer being called. This was due to the change of using
`item[CLASS]` instead of `worker_class` to set `job_class` in
`SidekiqUniqueJobs::Middelware#call`. `item[CLASS]` is a string, where
as `worker_class` can be either an instance, or the class itself. For the
instance level `after_unlock` to work, we need `job_class` to be an
instance of the worker.

This fixes the issue by switching back to setting `job_class` to
`worker_class`

CHANGELOG --------------------------------------------------------------

- User worker_class for self.job_class in Middleware#call
adamcreekroad added a commit to adamcreekroad/sidekiq-unique-jobs that referenced this pull request Oct 26, 2022
BACKGROUND -------------------------------------------------------------

mhenrixon#707 introduced a regression where the instance level `after_unlock`
callback is no longer being called. This was due to the change of using
`item[CLASS]` instead of `worker_class` to set `job_class` in
`SidekiqUniqueJobs::Middelware#call`. `item[CLASS]` is a string, where
as `worker_class` can be either an instance, or the class itself. For the
instance level `after_unlock` to work, we need `job_class` to be an
instance of the worker.

This fixes the issue by switching back to setting `job_class` to
`worker_class`

CHANGELOG --------------------------------------------------------------

- Use worker_class for self.job_class in Middleware#call
adamcreekroad added a commit to adamcreekroad/sidekiq-unique-jobs that referenced this pull request Oct 27, 2022
BACKGROUND -------------------------------------------------------------

mhenrixon#707 introduced a regression where the instance level `after_unlock`
callback is no longer being called. This was due to the change of using
`item[CLASS]` instead of `worker_class` to set `job_class` in
`SidekiqUniqueJobs::Middelware#call`. `item[CLASS]` is a string, where
as `worker_class` can be either an instance, or the class itself. For the
instance level `after_unlock` to work, we need `job_class` to be an
instance of the worker.

This fixes the issue by switching back to setting `job_class` to
`worker_class`

CHANGELOG --------------------------------------------------------------

- Use worker_class for self.job_class in Middleware#call
mhenrixon added a commit that referenced this pull request Dec 3, 2022
BACKGROUND -------------------------------------------------------------

#707 introduced a regression where the instance level `after_unlock`
callback is no longer being called. This was due to the change of using
`item[CLASS]` instead of `worker_class` to set `job_class` in
`SidekiqUniqueJobs::Middelware#call`. `item[CLASS]` is a string, where
as `worker_class` can be either an instance, or the class itself. For the
instance level `after_unlock` to work, we need `job_class` to be an
instance of the worker.

This fixes the issue by switching back to setting `job_class` to
`worker_class`

CHANGELOG --------------------------------------------------------------

- Use worker_class for self.job_class in Middleware#call

Co-authored-by: Mikael Henriksson <mikael@mhenrixon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment