Skip to content

Commit

Permalink
修改task finish错误
Browse files Browse the repository at this point in the history
  • Loading branch information
titrxw committed Jan 21, 2021
1 parent 3873ac2 commit f79250c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Src/Core/Listener/TaskListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private function dispatchTask(Server $server, Task $task) {
$this->getContainer()->singleton(HandlerExceptions::class)->getHandler()->report($throwable);
}

$task->finish($message->result);
$task->finish($message);
}

$this->getEventDispatcher()->dispatch(ServerEvent::ON_USER_AFTER_TASK, [$server, $task]);
Expand Down
1 change: 1 addition & 0 deletions Src/Core/Task/TaskDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ protected function dispatchNow($message, $server = null, $taskId = null, $worker
try {
$message->result = call_user_func_array([$task, $message->method], [$server, $taskId, $workId, $message->params ?? []]);
} catch (\Throwable $e) {
$message->result = $e->getMessage();
$task->fail($e);
throw $e;
}
Expand Down

0 comments on commit f79250c

Please sign in to comment.