Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yangxiuchengv5 opened this issue Sep 24, 2020 · 1 comment

Comments

@yangxiuchengv5
Copy link
Contributor

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

@yangxiuchengv5
Copy link
Contributor Author

The REDIS cluster does not support the SCAN directive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant