modify plugin name
This commit is contained in:
@@ -93,17 +93,18 @@ class DatabasesProviders extends Providers
|
|||||||
*/
|
*/
|
||||||
public function check(OnTaskerStart|OnWorkerStart $start): void
|
public function check(OnTaskerStart|OnWorkerStart $start): void
|
||||||
{
|
{
|
||||||
Timer::after(10000, [$this, 'filter']);
|
Timer::tick(10000, [$this, 'filter']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param $timerId
|
||||||
* @return void
|
* @return void
|
||||||
* @throws ConfigException
|
* @throws ConfigException
|
||||||
* @throws ContainerExceptionInterface
|
* @throws ContainerExceptionInterface
|
||||||
* @throws NotFoundExceptionInterface
|
* @throws NotFoundExceptionInterface
|
||||||
*/
|
*/
|
||||||
public function filter(): void
|
public function filter($timerId): void
|
||||||
{
|
{
|
||||||
$valid = $count = 0;
|
$valid = $count = 0;
|
||||||
$logger = Kiri::getDi()->get(LoggerInterface::class);
|
$logger = Kiri::getDi()->get(LoggerInterface::class);
|
||||||
@@ -114,9 +115,8 @@ 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)) {
|
if ($this->container->get(WorkerStatus::class)->is(StatusEnum::EXIT)) {
|
||||||
return;
|
Timer::clear($timerId);
|
||||||
}
|
}
|
||||||
Timer::after(10000, [$this, 'filter']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user