* Optimized 改正变量单词拼写

* Update SignalManager.php

* Update CHANGELOG-2.1.md

Co-authored-by: 李铭昕 <715557344@qq.com>
This commit is contained in:
zxyfaxcn 2021-02-19 19:18:45 +08:00 committed by GitHub
parent d5382e7eb8
commit 9a9ee695d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 27 additions and 10 deletions

View File

@ -62,7 +62,7 @@
## Fixed
- [#2913](https://github.com/hyperf/hyperf/pull/2913) Fixed memory leak when using `with()` for ORM.
- [#2915](https://github.com/hyperf/hyperf/pull/2915) Fixed bug that worker will be stoped when `onMessage` or `onClose` failed in websocket server.
- [#2915](https://github.com/hyperf/hyperf/pull/2915) Fixed bug that worker will be stopped when `onMessage` or `onClose` failed in websocket server.
- [#2927](https://github.com/hyperf/hyperf/pull/2927) Fixed validation rule `alpha_dash` does not support `int`.
## Changed

View File

@ -13,6 +13,7 @@
## Changed
- [#3258](https://github.com/hyperf/hyperf/pull/3258) Set different client ids based on different kafka consumers.
- [#3282](https://github.com/hyperf/hyperf/pull/3282) Renamed `stoped` to `stopped` for `hyperf/signal`.
# v2.1.6 - 2021-02-08

View File

@ -134,7 +134,7 @@
## Fixed
- [#2913](https://github.com/hyperf/hyperf/pull/2913) Fixed memory leak when using `with()` for ORM.
- [#2915](https://github.com/hyperf/hyperf/pull/2915) Fixed bug that worker will be stoped when `onMessage` or `onClose` failed in websocket server.
- [#2915](https://github.com/hyperf/hyperf/pull/2915) Fixed bug that worker will be stopped when `onMessage` or `onClose` failed in websocket server.
- [#2927](https://github.com/hyperf/hyperf/pull/2927) Fixed validation rule `alpha_dash` does not support `int`.
## Changed

View File

@ -42,7 +42,7 @@ class LogAfterProcessStoppedListener implements ListenerInterface
*/
public function process(object $event)
{
$message = sprintf('Process[%s.%d] stoped.', $event->process->name, $event->index);
$message = sprintf('Process[%s.%d] stopped.', $event->process->name, $event->index);
if ($this->container->has(StdoutLoggerInterface::class)) {
$logger = $this->container->get(StdoutLoggerInterface::class);
$logger->info($message);

View File

@ -42,6 +42,6 @@ class SignalDeregisterListener implements ListenerInterface
public function process(object $event)
{
$manager = $this->container->get(SignalManager::class);
$manager->setStoped(true);
$manager->setStopped(true);
}
}

View File

@ -40,7 +40,7 @@ class SignalManager
/**
* @var bool
*/
protected $stoped = false;
protected $stopped = false;
public function __construct(ContainerInterface $container)
{
@ -84,7 +84,7 @@ class SignalManager
}
}
if ($this->isStoped()) {
if ($this->isStopped()) {
break;
}
}
@ -92,17 +92,33 @@ class SignalManager
}
}
public function isStoped(): bool
public function isStopped(): bool
{
return $this->stoped;
return $this->stopped;
}
public function setStoped(bool $stoped): self
/**
* @deprecated v2.2
*/
public function isStoped(): bool
{
$this->stoped = $stoped;
return $this->isStopped();
}
public function setStopped(bool $stopped): self
{
$this->stopped = $stopped;
return $this;
}
/**
* @deprecated v2.2
*/
public function setStoped(bool $stopped): self
{
return $this->setStopped($stopped);
}
protected function isInvalidProcess(?int $process): bool
{
return ! in_array($process, [