Skip to content

Commit

Permalink
修复投递任务每次都在同一个task进程问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurunsoft committed Jun 21, 2018
1 parent 3bad566 commit 3748ffd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Task/TaskManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ abstract class TaskManager
* @param int $workerID
* @return int|bool
*/
public static function post(TaskInfo $taskInfo, $workerID = null)
public static function post(TaskInfo $taskInfo, $workerID = -1)
{
return ServerManage::getServer('main')->getSwooleServer()->task($taskInfo, $workerID, [$taskInfo->getTaskHandler(), 'finish']);
}
Expand All @@ -28,7 +28,7 @@ public static function post(TaskInfo $taskInfo, $workerID = null)
* @param int $workerID
* @return string|bool
*/
public static function postWait(TaskInfo $taskInfo, $timeout, $workerID = null)
public static function postWait(TaskInfo $taskInfo, $timeout, $workerID = -1)
{
$server = ServerManage::getServer('main')->getSwooleServer();
$result = $server->taskwait($taskInfo, $timeout, $workerID);
Expand Down

0 comments on commit 3748ffd

Please sign in to comment.