modify plugin name
This commit is contained in:
@@ -14,9 +14,13 @@ use Kiri\Events\EventProvider;
|
|||||||
use Kiri\Annotation\Inject;
|
use Kiri\Annotation\Inject;
|
||||||
use Kiri\Server\Events\OnWorkerStart;
|
use Kiri\Server\Events\OnWorkerStart;
|
||||||
use Kiri\Server\Events\OnTaskerStart;
|
use Kiri\Server\Events\OnTaskerStart;
|
||||||
|
use Psr\Container\ContainerExceptionInterface;
|
||||||
|
use Psr\Container\NotFoundExceptionInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Kiri\Server\Events\OnWorkerExit;
|
use Kiri\Server\Events\OnWorkerExit;
|
||||||
use Swoole\Timer;
|
use Swoole\Timer;
|
||||||
|
use Kiri\Server\WorkerStatus;
|
||||||
|
use Kiri\Server\Abstracts\StatusEnum;
|
||||||
use Kiri\Di\LocalService;
|
use Kiri\Di\LocalService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -96,6 +100,8 @@ class DatabasesProviders extends Providers
|
|||||||
/**
|
/**
|
||||||
* @return void
|
* @return void
|
||||||
* @throws ConfigException
|
* @throws ConfigException
|
||||||
|
* @throws ContainerExceptionInterface
|
||||||
|
* @throws NotFoundExceptionInterface
|
||||||
*/
|
*/
|
||||||
public function filter(): void
|
public function filter(): void
|
||||||
{
|
{
|
||||||
@@ -107,7 +113,9 @@ class DatabasesProviders extends Providers
|
|||||||
}
|
}
|
||||||
$const = 'Worker %d db client has %d, valid %d';
|
$const = 'Worker %d db client has %d, valid %d';
|
||||||
$logger->alert(sprintf($const, env('environmental_workerId'), $count, $valid));
|
$logger->alert(sprintf($const, env('environmental_workerId'), $count, $valid));
|
||||||
|
if ($this->container->get(WorkerStatus::class)->is(StatusEnum::EXIT)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Timer::after(10000, [$this, 'filter']);
|
Timer::after(10000, [$this, 'filter']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user