修复通道注册失败问题
This commit is contained in:
@@ -259,10 +259,14 @@ func addChans(chans []netip.AddrPort) error {
|
||||
var RedisScriptAddChans = `
|
||||
local free_key = KEYS[1]
|
||||
local all_key = KEYS[2]
|
||||
local chans = ARGV
|
||||
local chans = ARGV
|
||||
|
||||
redis.call("SADD", free_key, unpack(chans))
|
||||
redis.call("SADD", all_key, unpack(chans))
|
||||
local batch_size = 5000
|
||||
for i = 1, #chans, batch_size do
|
||||
local end_index = math.min(i + batch_size - 1, #chans)
|
||||
redis.call("SADD", free_key, unpack(chans, i, end_index))
|
||||
redis.call("SADD", all_key, unpack(chans, i, end_index))
|
||||
end
|
||||
|
||||
return 1
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user