Skip to content

Commit fd9ea7d

Browse files
committed
fix Crontab register.
1 parent 622f9db commit fd9ea7d

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/Sword.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010

1111
class Sword
1212
{
13-
const VERSION = '0.2.4';
13+
const VERSION = '0.2.5';
1414
}

src/SwordEvent.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use EasySwoole\Component\Di;
1212
use EasySwoole\EasySwoole\Command\CommandRunner;
1313
use EasySwoole\Command\Caller;
14-
use EasySwoole\Crontab\Crontab;
1514
use EasySwoole\EasySwoole\ServerManager;
1615
use EasySwoole\EasySwoole\Swoole\EventRegister;
1716
use EasySwoole\EasySwoole\SysConst;
@@ -135,7 +134,7 @@ public static function mainServerCreate(EventRegister $register)
135134
$crontabConfig->setServerName('SwordCrontab');
136135
// 3.设置用来执行定时任务的 worker 进程数
137136
$crontabConfig->setWorkerNum(2);
138-
$crontab = new Crontab($crontabConfig);
137+
$crontab = \EasySwoole\EasySwoole\Crontab\Crontab::getInstance($crontabConfig);
139138

140139
//取出配置目录全部文件
141140
foreach(scandir($path) as $file){
@@ -148,7 +147,6 @@ public static function mainServerCreate(EventRegister $register)
148147
}
149148
}
150149
}
151-
$crontab->attachToServer(ServerManager::getInstance()->getSwooleServer());
152150
}
153151

154152
/**

0 commit comments

Comments
 (0)