正在显示
1 个修改的文件
包含
1 行增加
和
1 行删除
@@ -121,7 +121,7 @@ trait RedisQuery { | @@ -121,7 +121,7 @@ trait RedisQuery { | ||
121 | */ | 121 | */ |
122 | public function add($key,$val,$ttl=null):mixed { | 122 | public function add($key,$val,$ttl=null):mixed { |
123 | return $this->getClient()->eval( | 123 | return $this->getClient()->eval( |
124 | - "return redis.call('exists',KEYS[1])<1 and redis.call('setex',KEYS[1],ARGV[2],ARGV[1])", | 124 | + "return redis.call('set', KEYS[1], ARGV[1], 'EX', ARGV[2], 'NX')", |
125 | [$key, $this->serialize($val), $ttl], | 125 | [$key, $this->serialize($val), $ttl], |
126 | 1 | 126 | 1 |
127 | ); | 127 | ); |
-
请 注册 或 登录 后发表评论