改名
This commit is contained in:
@@ -43,9 +43,6 @@ class ServerDefaultEvent extends Server
|
|||||||
*/
|
*/
|
||||||
public function onPipeMessage(\Swoole\Server $server, int $src_worker_id, mixed $message)
|
public function onPipeMessage(\Swoole\Server $server, int $src_worker_id, mixed $message)
|
||||||
{
|
{
|
||||||
if (is_null($message = unserialize($message))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!is_object($message) || !($message instanceof PipeMessage)) {
|
if (!is_object($message) || !($message instanceof PipeMessage)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,13 +74,11 @@ class Zookeeper implements CustomProcess
|
|||||||
private function dispatch(Redis|\Redis $redis, $value)
|
private function dispatch(Redis|\Redis $redis, $value)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$params['action'] = 'crontab';
|
|
||||||
if (empty($handler = $redis->get('crontab:' . $value))) {
|
if (empty($handler = $redis->get('crontab:' . $value))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$params['handler'] = swoole_unserialize($handler);
|
|
||||||
$server = ServerManager::getContext()->getServer();
|
$server = ServerManager::getContext()->getServer();
|
||||||
$server->sendMessage($params, $this->getWorker());
|
$server->sendMessage(swoole_unserialize($handler), $this->getWorker());
|
||||||
} catch (Throwable $exception) {
|
} catch (Throwable $exception) {
|
||||||
logger()->addError($exception);
|
logger()->addError($exception);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user