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

fix(locksmith): replace deprecated rpoplpush w/lmove #781

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/sidekiq_unique_jobs/locksmith.rb
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def brpoplpush(conn, wait)
# @api private
#
def rpoplpush(conn)
conn.rpoplpush(key.queued, key.primed)
conn.lmove(key.queued, key.primed, "RIGHT", "LEFT")

Choose a reason for hiding this comment

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

should we rename the method name too?

Copy link
Contributor Author

@GabrielaGuedes GabrielaGuedes May 12, 2023

Choose a reason for hiding this comment

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

thanks for the suggestion!! It got me thinking that if we changed the method name, we would also need to change the params it receives in order to be compliant with what lmove does. Do you think it is worth to do these changes?

Choose a reason for hiding this comment

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

@GabrielaGuedes I'm not the best to say. Hopefully a maintainer can chime in.
I'm just grateful someone is solving this annoying warning

end

#
Expand Down
2 changes: 1 addition & 1 deletion spec/support/sidekiq_unique_jobs/testing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def rpop(key)
end

def rpoplpush(source, destination)
redis { |conn| conn.rpoplpush(source, destination) }
redis { |conn| conn.lmove(source, destination, "RIGHT", "LEFT") }
end

def blpop(*args)
Expand Down