Skip to content

Commit

Permalink
refactor: lua
Browse files Browse the repository at this point in the history
  • Loading branch information
arusakov committed Oct 13, 2024
1 parent bc29c71 commit 9b71bf0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lua/channelRemove.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
local key = KEYS[1]
local chnl_key = ARGV[1]
local chnl_arg = ARGV[2]

local chnl_str = redis.call('HGET', key, chnl_key)
local chnl, cnt = string.gsub(chnl_str, ','..chnl_arg..',', ',')
local chnl, cnt = string.gsub(chnl_str, ','..ARGV[2]..',', ',')

if cnt > 0 then
redis.call('HSET', key, chnl_key, chnl)
Expand Down

0 comments on commit 9b71bf0

Please sign in to comment.