Skip to content

Commit d9df350

Browse files
committed
fixup! feat: fixup
1 parent 587ea9f commit d9df350

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lib/private/Memcache/KeyValueCache.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function hasKey($key) {
8080

8181
#[\Override]
8282
public function remove($key) {
83-
return (bool)$this->getCache()->unlink($this->getPrefix() . $key);
83+
return (bool)$this->getCache()->del($this->getPrefix() . $key);
8484
}
8585

8686
#[\Override]
@@ -165,7 +165,12 @@ public function inc($key, $step = 1) {
165165
*/
166166
#[\Override]
167167
public function dec($key, $step = 1) {
168-
$res = $this->evalLua('dec', [$key], [$step]);
168+
try {
169+
$res = $this->evalLua('dec', [$key], [$step]);
170+
} catch (ServerException) {
171+
// The stored value is not an integer
172+
return false;
173+
}
169174
return ($res === 'NEX') ? false : $res;
170175
}
171176

0 commit comments

Comments
 (0)