File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public function getPid(): int
1818 public static function instance (int $ pid ): ProcessContext
1919 {
2020 if (!isset (static ::$ instances [$ pid ])) {
21- static ::$ instances [$ pid ] = new static ($ pid );
21+ static ::$ instances [$ pid ] = new self ($ pid );
2222 }
2323 return static ::$ instances [$ pid ];
2424 }
Original file line number Diff line number Diff line change 88use Symfony \Component \HttpKernel \KernelEvents ;
99use Symfony \Contracts \Service \ResetInterface ;
1010use Tourze \Symfony \Aop \Model \ProcessContext ;
11- use Workerman \Timer ;
12- use Workerman \Worker ;
1311
1412/**
1513 * 上下文管理
@@ -42,7 +40,7 @@ public function isCoroutineRuntime(): bool
4240 */
4341 public function isWorkerman (): bool
4442 {
45- return Worker::$ pidFile !== '' ;
43+ return class_exists (\ Workerman \Worker::class) && \ Workerman \ Worker::$ pidFile !== '' ;
4644 }
4745
4846 public function isSwoole (): bool
@@ -78,7 +76,7 @@ public function defer(callable $callback): void
7876 }
7977
8078 if ($ this ->isWorkerman ()) {
81- Timer::add (0.001 , $ callback , persistent: false );
79+ \ Workerman \ Timer::add (0.001 , $ callback , persistent: false );
8280 return ;
8381 }
8482
You can’t perform that action at this time.
0 commit comments