Skip to content

Commit ffd2b07

Browse files
committed
fix group without last-delivered-id
1 parent 352bc97 commit ffd2b07

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -523,11 +523,7 @@ public function cleanup(): void
523523

524524
public function getMessageCount(): int
525525
{
526-
$groups = $this->connection->xinfo('GROUPS', $this->stream);
527-
528-
if (false === $groups) {
529-
throw new LogicException(sprintf('No group found for stream "%s".', $this->stream));
530-
}
526+
$groups = $this->connection->xinfo('GROUPS', $this->stream) ?: [];
531527

532528
$lastDeliveredId = null;
533529
foreach ($groups as $group) {
@@ -540,6 +536,10 @@ public function getMessageCount(): int
540536
return $group['lag'];
541537
}
542538

539+
if (!isset($group['last-delivered-id'])) {
540+
return 0;
541+
}
542+
543543
$lastDeliveredId = $group['last-delivered-id'];
544544
break;
545545
}

0 commit comments

Comments
 (0)