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

[QUESTION] Use lua script to prompt moved? #13273

Open
zzalyp opened this issue May 16, 2024 · 0 comments
Open

[QUESTION] Use lua script to prompt moved? #13273

zzalyp opened this issue May 16, 2024 · 0 comments

Comments

@zzalyp
Copy link

zzalyp commented May 16, 2024

I am using a lua script to implement a difference function. The specific lua code is as follows. After I execute it with spring boot, I will receive a "MOVED prompt". I don't quite understand why there is this prompt. I just created a temporary key and then used it as sdiff
My environment is cluster mode

lua

local key = KEYS[1]
local keyTmp = KEYS[2]
local values = ARGV[1]

local valuesArray = {}
for value in values:gmatch("[^,]+") do
    table.insert(valuesArray, value)
end


local ok, result = pcall(function()

    redis.call('SADD', keyTmp, unpack(valuesArray))
   
    local res = redis.call('SDIFF', keyTmp, key)
 
    redis.call('DEL', keyTmp)
    return {200, "success", res}
end)

if not ok then

    return {401, result,{}}
end

return result
@zzalyp zzalyp changed the title I am using a lua script to implement a difference function. The specific lua code is as follows. After I execute it with spring boot, I will receive a "MOVED prompt". I don't quite understand why there is this prompt. I just created a temporary key and then used it as sdiff. lua script generates moved May 16, 2024
@zzalyp zzalyp changed the title lua script generates moved Use lua script to prompt moved? May 16, 2024
@zzalyp zzalyp changed the title Use lua script to prompt moved? [QUESTION] Use lua script to prompt moved? May 16, 2024
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