apache / apache/openwhisk-apigateway

The method _M.getSubscriptions in redis.lua does not support RedisCluster???

Open
#384 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Lua
Stars
65
Forks
43
PR merge metrics
No merged PRs in 30d

Description

function _M.getSubscriptions(red, artifactId, tenantId, snapshotId)
local res = red:scan(0, "match", utils.concatStrings({"subscriptions:tenant:", tenantId, ":api:", artifactId, ":*"}))
local cursor = res[1]
local subscriptions = {}
for _, v in pairs(res[2]) **do**
local matched = {string.match(v, "subscriptions:tenant:([^:]+):api:([^:]+):([^:]+):([^:]+):*")}
subscriptions[#subscriptions + 1] = matched[4]
end
while cursor ~= "0" do
res = red:scan(cursor, "match", utils.concatStrings({"subscriptions:tenant:", tenantId, ":api:", artifactId, ":*"}))
cursor = res[1]
for _, v in pairs(res[2]) do
local matched = {string.match(v, "subscriptions:tenant:([^:]+):api:([^:]+):([^:]+):([^:]+):*")}
subscriptions[#subscriptions + 1] = matched[4]
end
end
return subscriptions
end

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.