Commit 3cb7d4c2 by 王召彬

修改为sgo

parent 1a0670ea
...@@ -84,7 +84,7 @@ class ClsLog ...@@ -84,7 +84,7 @@ class ClsLog
$logFile = \alias('@runtime').'/logs/'.$filename; $logFile = \alias('@runtime').'/logs/'.$filename;
if (Co::id() > 0) { if (Co::id() > 0) {
// 协程写 // 协程写
go(function () use ($logFile, $messageText) { sgo(function () use ($logFile, $messageText) {
$res = Coroutine::writeFile($logFile, $messageText, FILE_APPEND); $res = Coroutine::writeFile($logFile, $messageText, FILE_APPEND);
if ($res === false) { if ($res === false) {
throw new \InvalidArgumentException("Unable to append to log file: {$logFile}"); throw new \InvalidArgumentException("Unable to append to log file: {$logFile}");
......
...@@ -84,7 +84,7 @@ class LogHandler extends AbstractProcessingHandler ...@@ -84,7 +84,7 @@ class LogHandler extends AbstractProcessingHandler
if($this->topicId == ClsLog::TOPICID_ERROR) { if($this->topicId == ClsLog::TOPICID_ERROR) {
if (Co::id() > 0) { if (Co::id() > 0) {
go(function () use ($messageText) { sgo(function () use ($messageText) {
ClsLog::error($messageText); ClsLog::error($messageText);
}); });
} else { } else {
...@@ -92,7 +92,7 @@ class LogHandler extends AbstractProcessingHandler ...@@ -92,7 +92,7 @@ class LogHandler extends AbstractProcessingHandler
} }
} else if($this->topicId == ClsLog::TOPICID_NOTICE) { } else if($this->topicId == ClsLog::TOPICID_NOTICE) {
if (Co::id() > 0) { if (Co::id() > 0) {
go(function () use ($messageText) { sgo(function () use ($messageText) {
ClsLog::notice($messageText); ClsLog::notice($messageText);
}); });
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment