Skip to content

Commit 50697d0

Browse files
committed
feat: add $pidFile
1 parent 383e843 commit 50697d0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Service.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
class Service extends BaseService {
66
public function register(){
77
$this->commands([
8-
'worker:task'=>'\\cathy\\AsyncTask\\command\\AsyncTaskService',
9-
'worker:websocket'=>'\\cathy\\AsyncTask\\command\\WebsocketService',
8+
'worker:task'=>'\\cathy\\AsyncTask\\command\\AsyncTaskService'
109
]);
1110
}
1211
}

src/command/AsyncTaskService.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public function start(string $host, int $port, array $option = []){
101101
if(isset($option['daemon']) && $option['daemon']){
102102
Worker::$daemonize = true;
103103
}
104+
Worker::$pidFile = app()->getRootPath().'AsyncTask.pid';
104105
$task_worker = new Worker('tcp://'.$host.':'.$port);
105106
$task_worker->count = $option['count']; // 进程数
106107
$task_worker->name = $option['name']; // 名称

0 commit comments

Comments
 (0)