Skip to content

Commit 4b7df57

Browse files
author
niulingyun
committed
redis 当设置了过期时间时,需要追加EX前缀 SET key value [EX seconds]
1 parent 057013a commit 4b7df57

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Pools/CoroutineRedisProxy.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@ public function __call(string $name, array $arguments)
200200
switch (strtolower($name)) {
201201
case 'set':
202202
$arguments[2] = $this->serializeHandler($arguments[2], true);
203+
if (is_int($arguments[3])) {
204+
//当设置了过期时间时,需要追加EX前缀 SET key value [EX seconds]
205+
array_splice($arguments, 3, 0, 'EX');
206+
}
203207
break;
204208
case 'setex':
205209
$arguments[3] = $this->serializeHandler($arguments[3], true);

0 commit comments

Comments
 (0)