redis lua 检查和设置不起作用

在运行以下脚本后通过redis-cli.exe --eval test.lua,get foo仍然打印1.

local current = redis.call('GET', 'foo')
--我还试过了current = redis.call ('GET','foo').ok
if current == 1
    then redis.call('SET', 'foo', 2)
end
if current == '1'
    then redis.call('SET', 'foo', 3)
end
点赞