Skip to content

Commit

Permalink
fix: Class 'Swoole\Coroutine' not found
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere authored Dec 17, 2020
1 parent 9a0146b commit 2340d5a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions run.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,14 @@

$status = 0;

Coroutine::set([
'log_level' => SWOOLE_LOG_INFO,
'trace_flags' => 0
]);
// fix: swoole >= 4.5.9
if (class_exists('Swoole\Coroutine', false)) {
Coroutine::set([
'log_level' => SWOOLE_LOG_INFO,
'trace_flags' => 0
]);
}

\Swoft\Co::run(function () {
// Status
global $status;
Expand Down

0 comments on commit 2340d5a

Please sign in to comment.