Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Removes deprecation warning by using pipelined block form #231

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions lib/lita/room.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ def hash
def save
ensure_name_metadata_set

redis.pipelined do
redis.hmset("id:#{id}", *metadata.to_a.flatten)
redis.set("name:#{name}", id)
redis.pipelined do |pipeline|
pipeline.hmset("id:#{id}", *metadata.to_a.flatten)
pipeline.set("name:#{name}", id)
end
end

Expand Down
10 changes: 5 additions & 5 deletions lib/lita/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ def save
redis_keys = redis.hkeys("id:#{id}")
delete_keys = (redis_keys - current_keys)

redis.pipelined do
redis.hdel("id:#{id}", *delete_keys) if delete_keys.any?
redis.hmset("id:#{id}", *metadata.to_a.flatten)
redis.set("name:#{name}", id)
redis.set("mention_name:#{mention_name}", id) if mention_name
redis.pipelined do |pipeline|
pipeline.hdel("id:#{id}", *delete_keys) if delete_keys.any?
pipeline.hmset("id:#{id}", *metadata.to_a.flatten)
pipeline.set("name:#{name}", id)
pipeline.set("mention_name:#{mention_name}", id) if mention_name
end
end

Expand Down