src/Adapter/PhpredisAdapter.php 1 location
|
@@ 77-81 (lines=5) @@
|
74 |
|
|
75 |
|
public function set(string $key, $value): bool |
76 |
|
{ |
77 |
|
if ($this->ttl === null) { |
78 |
|
$result = $this->getClient()->set($key, $value); |
79 |
|
} else { |
80 |
|
$result = $this->getClient()->setex($key, $this->ttl, $value); |
81 |
|
} |
82 |
|
|
83 |
|
return (bool) $result; |
84 |
|
} |
src/Adapter/RedisAdapter.php 1 location
|
@@ 75-79 (lines=5) @@
|
72 |
|
|
73 |
|
public function set(string $key, $value): bool |
74 |
|
{ |
75 |
|
if ($this->ttl == 0) { |
76 |
|
$result = $this->getClient()->set($key, $value); |
77 |
|
} else { |
78 |
|
$result = $this->getClient()->set($key, $value, static::EXPIRE_RESOLUTION_EX, $this->ttl); |
79 |
|
} |
80 |
|
|
81 |
|
return $result->getPayload() == 'OK'; |
82 |
|
} |