This commit is contained in:
as2252258@163.com
2021-03-26 01:05:07 +08:00
parent d38c66a92d
commit a341734a33
+6 -1
View File
@@ -22,6 +22,8 @@ use Rpc\Producer;
use Rpc\Service; use Rpc\Service;
use Snowflake\Abstracts\Config; use Snowflake\Abstracts\Config;
use Snowflake\Core\Json; use Snowflake\Core\Json;
use Snowflake\Crontab\Consumer;
use Snowflake\Crontab\CrontabZookeeperProcess;
use Snowflake\Error\LoggerProcess; use Snowflake\Error\LoggerProcess;
use Snowflake\Event; use Snowflake\Event;
use Snowflake\Exception\ComponentException; use Snowflake\Exception\ComponentException;
@@ -131,7 +133,10 @@ class Server extends HttpService
public function start(): string public function start(): string
{ {
$configs = Config::get('servers', true); $configs = Config::get('servers', true);
if (Config::get('crontab.enable') === true) {
$this->addProcess('CrontabZookeeper', CrontabZookeeperProcess::class);
$this->addProcess('CrontabConsumer', Consumer::class);
}
$baseServer = $this->initCore($configs); $baseServer = $this->initCore($configs);
if (!$baseServer) { if (!$baseServer) {
return 'ok'; return 'ok';