Skip to content

Commit a0beaf5

Browse files
authored
Merge pull request #434 from iclukas/fix-redis-invalidation
Fix Redis invalidation
2 parents 64a8134 + 3233479 commit a0beaf5

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

src/Stash/Driver/Redis.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,8 @@ public function storeData($key, $data, $expiration)
201201
$store = serialize(array('data' => $data, 'expiration' => $expiration));
202202
if (is_null($expiration)) {
203203
return $this->redis->set($this->makeKeyString($key), $store);
204-
} else {
205-
$ttl = $expiration - time();
206-
207-
// Prevent us from even passing a negative ttl'd item to redis,
208-
// since it will just round up to zero and cache forever.
209-
if ($ttl < 1) {
210-
return true;
211-
}
212-
213-
return $this->redis->setex($this->makeKeyString($key), $ttl, $store);
214204
}
205+
return $this->redis->set($this->makeKeyString($key), $store, array('EXAT' => $expiration));
215206
}
216207

217208
/**

0 commit comments

Comments
 (0)