Skip to content

Commit 2b22214

Browse files
committed
[#V1] Improve hmset method debugging and flexibility
* Allows optional hash parameter for hmset method * Adds tracing for HMSET operations in debug mode ( Provides more flexible way to set multiple hash fields
1 parent 741e27d commit 2b22214

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/familia/horreum/commands.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,10 @@ def hset(field, value)
107107
redis.hset rediskey, field, value
108108
end
109109

110-
def hmset
111-
redis.hmset rediskey(suffix), self.to_h
110+
def hmset(hsh={})
111+
hsh ||= self.to_h
112+
Familia.trace :HMSET, redis, hsh, caller(1..1) if Familia.debug?
113+
redis.hmset rediskey(suffix), hsh
112114
end
113115

114116
def hkeys

0 commit comments

Comments
 (0)