Skip to content

Commit

Permalink
Fixed a bug where channels could not specify workerId publication
Browse files Browse the repository at this point in the history
  • Loading branch information
chaz6chez committed May 17, 2024
1 parent f589eb7 commit cbc351e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Traits/ChannelMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,18 @@ protected static function _ChPublish(string $key, mixed $message, bool $store =
else {
// 非指定workerId
if ($workerId === null) {
if ($store or isset($channel[$workerId]['futureId'])) {
$channel[$workerId]['value'][] = $message;
}
}
// 指定workerId
else {
foreach ($channel as $workerId => $item) {
if ($store or isset($item['futureId'])) {
$channel[$workerId]['value'][] = $message;
}
}
}
// 指定workerId
else {
if ($store or isset($channel[$workerId]['futureId'])) {
$channel[$workerId]['value'][] = $message;
}
}
}

self::_Set($channelName, $channel);
Expand Down

0 comments on commit cbc351e

Please sign in to comment.