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

lua: redis support expire #36

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

T-Mac1991
Copy link

lua: redis support expire, eg:

local ops = require("redisOps") --加载redis操作模块
local row = ops.rawRow() --当前数据库的一行数据,table类型,key为列名称
local action = ops.rawAction() --当前数据库事件,包括:insert、update、delete
local key = tostring(row["id"])
if action == "insert" or action == "update" -- 监听insert update事件
then
for k, v in pairs(row) do
ops.HSET(key,k,v)
end

**ops.EXPIRE(key, 200)  --设置过期时间**

else-- 监听删除事件
ops.DEL(key) -- 删除旧值
end

lua: redis support expire
"expire" it will not work when the key not exist, swap it
use tuple to swap value
@inbjo
Copy link

inbjo commented Apr 14, 2021

@T-Mac1991 大佬能否也支持一下hget get这几个读的操作 想实现只有某几个字段发生变化 然后再发送post请求

@hb520
Copy link

hb520 commented Apr 23, 2021

不支持expire 这个有点恶心

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

Successfully merging this pull request may close these issues.

3 participants