Skip to content

Commit

Permalink
fixed claim error
Browse files Browse the repository at this point in the history
  • Loading branch information
chaz6chez committed Jan 12, 2024
1 parent e2e83b7 commit d7d4a28
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/HookServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,17 @@ public function ack(string $queue, string $group, array $idArray): bool
public function claim(string $queue, string $group, string $consumer)
{
try {
if ($idArray = self::getStorage()->xAutoClaim(
$idArray = self::getStorage()->xAutoClaim(
$queue, $group, $consumer,
self::getConfig('pending_timeout', 60 * 60) * 1000,
'0-0', -1, true
)) {
);
foreach ($idArray as $k => $v) {
if (!$v or $v === '0-0') {
unset($idArray[$k]);
}
}
if ($idArray) {
if (self::getStorage()->xAck($queue, $group, $idArray)) {
self::getStorage()->xDel($queue, $idArray);
}
Expand Down

0 comments on commit d7d4a28

Please sign in to comment.