modify
This commit is contained in:
@@ -46,10 +46,11 @@ class OnPipeMessage extends Callback
|
|||||||
*/
|
*/
|
||||||
private function onCrontabWorker(array $message): string
|
private function onCrontabWorker(array $message): string
|
||||||
{
|
{
|
||||||
if (empty($handler = $message['handler'] ?? null)) {
|
if (empty($message['handler'] ?? null)) {
|
||||||
throw new Exception('unknown handler');
|
throw new Exception('unknown handler');
|
||||||
}
|
}
|
||||||
/** @var Crontab $handler */
|
/** @var Crontab $handler */
|
||||||
|
$handler = swoole_unserialize($message['handler']);
|
||||||
defer(function () use ($handler) {
|
defer(function () use ($handler) {
|
||||||
$return = $handler->isRecover();
|
$return = $handler->isRecover();
|
||||||
if ($return === 999) {
|
if ($return === 999) {
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class Zookeeper extends Process
|
|||||||
if (empty($handler = $redis->get('crontab:' . $value))) {
|
if (empty($handler = $redis->get('crontab:' . $value))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$params['handler'] = swoole_unserialize($handler);
|
$params['handler'] = $handler;
|
||||||
|
|
||||||
$this->server->sendMessage($params, $this->getWorker());
|
$this->server->sendMessage($params, $this->getWorker());
|
||||||
} catch (Throwable $exception) {
|
} catch (Throwable $exception) {
|
||||||
|
|||||||
Reference in New Issue
Block a user