Skip to content

Commit

Permalink
fixed xAutoClaim not found
Browse files Browse the repository at this point in the history
  • Loading branch information
chaz6chez committed Mar 19, 2024
1 parent d6f61b2 commit 3dcec42
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/HookServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ public function ack(string $queue, string $group, array $idArray): bool
*/
public function claim(string $queue, string $group, string $consumer)
{
if (!method_exists(self::getStorage(), 'xAutoClaim')) {
Log::channel('plugin.workbunny.webman-push-server.warning')->warning(
'Method xAutoClaim requires redis-server >= 6.2.0. '
);
return;
}
try {
if ($idArray = self::getStorage()->xAutoClaim(
$queue, $group, $consumer,
Expand Down Expand Up @@ -313,7 +319,7 @@ function () {
$interval = self::getConfig('claim_interval', 0);
if ($interval > 0) {
$this->_claimTimer = Timer::add(
self::getConfig('claim_interval'),
$interval,
function () use ($queue, $group, $consumer) {
$this->claim($queue, $group, $consumer);
}
Expand Down

0 comments on commit 3dcec42

Please sign in to comment.