@maiyunnet/kebab 9.29.0 → 9.29.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,6 +51,7 @@ if op == 'create' then
51
51
  end
52
52
  local r = cjson.decode(data)
53
53
  r.timeAdd = tonumber(redis.call('TIME')[1])
54
+ r.timeLast = r.timeAdd
54
55
  r.index = idx
55
56
  redis.call('SET', record(hash), cjson.encode(r))
56
57
  expiry(hash, r, ttl)
@@ -66,6 +67,8 @@ if op == 'get' then
66
67
  end
67
68
  if me.uid ~= ARGV[3] then return nil end
68
69
  if op == 'touch' then
70
+ me.timeLast = tonumber(redis.call('TIME')[1])
71
+ redis.call('SET', record(hash), cjson.encode(me))
69
72
  expiry(hash, me, tonumber(ARGV[4]))
70
73
  return 1
71
74
  end
@@ -114,7 +117,7 @@ function uidValid(uid) {
114
117
  }
115
118
  function record(value) {
116
119
  const row = value;
117
- return { ...row, data: JSON.parse(row.data) };
120
+ return { ...row, timeAdd: row.timeAdd ?? 0, timeLast: row.timeLast ?? 0, data: JSON.parse(row.data) };
118
121
  }
119
122
  function parse(value) {
120
123
  if (value === null || value === false)