diff --git a/Server/SInterface/PipeMessage.php b/Server/SInterface/PipeMessage.php index e8be03c8..f734d413 100644 --- a/Server/SInterface/PipeMessage.php +++ b/Server/SInterface/PipeMessage.php @@ -17,16 +17,5 @@ interface PipeMessage public function process(): void; - /** - * - */ - public function max_execute(): void; - - - /** - * @return bool - */ - public function isStop(): bool; - } diff --git a/System/Crontab/Crontab.php b/System/Crontab/Crontab.php index 6b4c274c..eef76959 100644 --- a/System/Crontab/Crontab.php +++ b/System/Crontab/Crontab.php @@ -16,7 +16,7 @@ use Swoole\Timer; * @package Snowflake * @property Application $application */ -abstract class Crontab implements PipeMessage +abstract class Crontab implements PipeMessage, CrontabInterface { const WAIT_END = 'crontab:wait:execute'; @@ -247,7 +247,7 @@ abstract class Crontab implements PipeMessage if (!$this->isMaxExecute()) { return 999; } - call_user_func([$this, 'max_execute']); + call_user_func([$this, 'onMaxExecute']); return $redis->del('crontab:' . $crontab_name); } catch (\Throwable $throwable) { return $this->application->addError($throwable, 'throwable'); diff --git a/System/Crontab/CrontabInterface.php b/System/Crontab/CrontabInterface.php new file mode 100644 index 00000000..418b1cb2 --- /dev/null +++ b/System/Crontab/CrontabInterface.php @@ -0,0 +1,20 @@ +