Guest User

Untitled

a guest
Jun 23rd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. local a = redis.call('get',KEYS[1]);
  2. if a and a:find("^updateat:") ~= nil then
  3. -- this key already update by anther thread. so we test
  4. if tonumber(string.sub(a, 10, string.len(a))) <= tonumber(KEYS[2]) then
  5. return redis.call('set',KEYS[1], KEYS[3]);
  6. end
  7. return;
  8. end
  9. return redis.call('set',KEYS[1], KEYS[3]);
Add Comment
Please, Sign In to add comment