Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit b7ba98a

Browse files
committed
Enforce topic subscription
1 parent 40f024d commit b7ba98a

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/ChannelManagers/RedisChannelManager.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,7 @@ public function unsubscribeFromAllChannels(ConnectionInterface $connection)
158158
*/
159159
public function subscribeToChannel(ConnectionInterface $connection, string $channelName, stdClass $payload)
160160
{
161-
$this->getGlobalConnectionsCount($connection->app->id, $channelName)
162-
->then(function ($count) use ($connection, $channelName) {
163-
if ($count === 0) {
164-
$this->subscribeToTopic($connection->app->id, $channelName);
165-
}
166-
});
161+
$this->subscribeToTopic($connection->app->id, $channelName);
167162

168163
$this->addConnectionToSet($connection);
169164

@@ -753,13 +748,13 @@ public function getRedisKey($appId = null, string $channel = null, array $suffix
753748
$hash = "{$prefix}{$appId}";
754749

755750
if ($channel) {
756-
$hash .= ":{$channel}";
751+
$suffixes = array_merge([$channel], $suffixes);
757752
}
758753

759-
$suffixes = join(':', $suffixes);
754+
$suffixes = implode(':', $suffixes);
760755

761756
if ($suffixes) {
762-
$hash .= $suffixes;
757+
$hash .= ":{$suffixes}";
763758
}
764759

765760
return $hash;

0 commit comments

Comments
 (0)