Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local a = redis.call('get',KEYS[1]);
- if a and a:find("^updateat:") ~= nil then
- -- this key already update by anther thread. so we test
- if tonumber(string.sub(a, 10, string.len(a))) <= tonumber(KEYS[2]) then
- return redis.call('set',KEYS[1], KEYS[3]);
- end
- return;
- end
- return redis.call('set',KEYS[1], KEYS[3]);
Add Comment
Please, Sign In to add comment