Skip to content

Commit

Permalink
feat:optimize cron code
Browse files Browse the repository at this point in the history
  • Loading branch information
bingcool committed Sep 8, 2024
1 parent 0aadb67 commit 46441f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Tcp/TcpServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function start()
$this->tcpServer->on('connect', function (\Swoole\Server $server, $fd) {
try {
(new EventApp())->registerApp(function () use ($server, $fd) {
static::onConnect($server, $fd);
$this->onConnect($server, $fd);
});
} catch (\Throwable $e) {
self::catchException($e);
Expand Down Expand Up @@ -201,7 +201,7 @@ public function start()
foreach ($contextData as $key=>$value) {
\Swoolefy\Core\Coroutine\Context::set($key, $value);
}
static::onFinish($server, $task_id, $data);
$this->onFinish($server, $task_id, $data);
});
return true;
} catch (\Throwable $e) {
Expand All @@ -215,7 +215,7 @@ public function start()
$this->tcpServer->on('pipeMessage', function (\Swoole\Server $server, $from_worker_id, $message) {
try {
(new EventApp())->registerApp(function () use ($server, $from_worker_id, $message) {
static::onPipeMessage($server, $from_worker_id, $message);
$this->onPipeMessage($server, $from_worker_id, $message);
});
return true;
} catch (\Throwable $e) {
Expand All @@ -232,7 +232,7 @@ public function start()
$this->Pack->destroy();
}
(new EventApp())->registerApp(function () use ($server, $fd) {
static::onClose($server, $fd);
$this->onClose($server, $fd);
});
} catch (\Throwable $e) {
self::catchException($e);
Expand Down

0 comments on commit 46441f2

Please sign in to comment.