From e92c9b8780219c8a9bb67c1391a1c7095eea176c Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Fri, 26 Mar 2021 02:13:18 +0800 Subject: [PATCH] modify --- System/Application.php | 4 +--- System/Crontab/CrontabProviders.php | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/System/Application.php b/System/Application.php index 990e57be..df3bcd3f 100644 --- a/System/Application.php +++ b/System/Application.php @@ -56,9 +56,7 @@ class Application extends BaseApplication $this->import(DatabasesProviders::class); $this->import(ServerProviders::class); - if (Config::get('crontab.enable') !== true) { - $this->import(CrontabProviders::class); - } + $this->import(CrontabProviders::class); } diff --git a/System/Crontab/CrontabProviders.php b/System/Crontab/CrontabProviders.php index 32450c8c..c319c647 100644 --- a/System/Crontab/CrontabProviders.php +++ b/System/Crontab/CrontabProviders.php @@ -23,11 +23,10 @@ class CrontabProviders extends Providers public function onImport(Application $application) { $server = $application->getServer(); + $application->set('crontab', ['class' => Producer::class]); if (Config::get('crontab.enable') !== true) { return; } - $application->set('crontab', ['class' => Producer::class]); - $server->addProcess('CrontabZookeeper', ZookeeperProcess::class); $server->addProcess('Consumer', Consumer::class); }