改名
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)
|
||||
{
|
||||
if (is_null($message = unserialize($message))) {
|
||||
return;
|
||||
}
|
||||
if (!is_object($message) || !($message instanceof PipeMessage)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -74,13 +74,11 @@ class Zookeeper implements CustomProcess
|
||||
private function dispatch(Redis|\Redis $redis, $value)
|
||||
{
|
||||
try {
|
||||
$params['action'] = 'crontab';
|
||||
if (empty($handler = $redis->get('crontab:' . $value))) {
|
||||
return;
|
||||
}
|
||||
$params['handler'] = swoole_unserialize($handler);
|
||||
$server = ServerManager::getContext()->getServer();
|
||||
$server->sendMessage($params, $this->getWorker());
|
||||
$server->sendMessage(swoole_unserialize($handler), $this->getWorker());
|
||||
} catch (Throwable $exception) {
|
||||
logger()->addError($exception);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user