Skip to content

Commit d76213b

Browse files
Adam Roses Wightejegg
authored andcommitted
Correct Redis incr/decr when count > 1
Change-Id: I35ff52c810f4bc11d403ddbb2eba0c290b641b41
1 parent 6bac0f4 commit d76213b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/PHPQueue/Backend/Predis.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public function incrKey($key, $count=1)
205205
if (!$this->keyExists($key)) {
206206
return false;
207207
}
208-
if ($count > 1) {
208+
if ($count === 1) {
209209
$status = $this->getConnection()->incr($key);
210210
} else {
211211
$status = $this->getConnection()->incrby($key, $count);
@@ -219,7 +219,7 @@ public function decrKey($key, $count=1)
219219
if (!$this->keyExists($key)) {
220220
return false;
221221
}
222-
if ($count > 1) {
222+
if ($count === 1) {
223223
$status = $this->getConnection()->decr($key);
224224
} else {
225225
$status = $this->getConnection()->decrby($key, $count);

0 commit comments

Comments
 (0)