eee
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Kiri\Server\Abstracts;
|
||||
|
||||
use Kiri\Server\ServerInterface;
|
||||
use Swoole\Process;
|
||||
|
||||
trait ReloadWorkers
|
||||
@@ -29,16 +30,7 @@ trait ReloadWorkers
|
||||
private function reloadByServerInstance(): bool
|
||||
{
|
||||
try {
|
||||
$server = function_exists('di') ? di(\Kiri\Server\ServerInterface::class) : null;
|
||||
} catch (\Throwable) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_object($server) || !method_exists($server, 'reload')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
$server = di(ServerInterface::class) ;
|
||||
return $server->reload() !== false;
|
||||
} catch (\Throwable) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user