We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ab0a547 + b96f4a7 commit 1686e38Copy full SHA for 1686e38
cache/driver/redis.php
@@ -123,15 +123,17 @@ protected function _read(string $var)
123
}
124
125
/**
126
- * {@inheritDoc}
127
- */
+ * Store data in the cache
+ *
128
+ * For the info, see https://phpredis.github.io/phpredis/Redis.html#method_set,
129
+ * https://redis.io/docs/latest/commands/set/
130
+ * and https://redis.io/docs/latest/commands/expire/#appendix-redis-expires
131
132
+ * {@inheritDoc}
133
+ */
134
protected function _write(string $var, $data, int $ttl = 2592000): bool
135
{
- if ($ttl == 0)
- {
- return $this->redis->set($var, $data);
- }
- return $this->redis->setex($var, $ttl, $data);
136
+ return $this->redis->set($var, $data, ['EXAT' => time() + $ttl]);
137
138
139
0 commit comments