改名
This commit is contained in:
@@ -45,6 +45,18 @@ class Crontab extends BaseObject
|
|||||||
private array|Closure|null $_max_execute_handler = null;
|
private array|Closure|null $_max_execute_handler = null;
|
||||||
|
|
||||||
|
|
||||||
|
private bool $_stop = false;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function stop()
|
||||||
|
{
|
||||||
|
$this->_stop = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
@@ -116,6 +128,9 @@ class Crontab extends BaseObject
|
|||||||
*/
|
*/
|
||||||
public function setHandler(array|Closure $handler): void
|
public function setHandler(array|Closure $handler): void
|
||||||
{
|
{
|
||||||
|
if ($handler instanceof Closure) {
|
||||||
|
Closure::bind($handler, $this, $this);
|
||||||
|
}
|
||||||
$this->handler = $handler;
|
$this->handler = $handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,6 +270,9 @@ class Crontab extends BaseObject
|
|||||||
*/
|
*/
|
||||||
private function after(): void
|
private function after(): void
|
||||||
{
|
{
|
||||||
|
if ($this->_stop === true) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ($this->isLoop()) {
|
if ($this->isLoop()) {
|
||||||
$this->recover();
|
$this->recover();
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user