Skip to content

Commit 739bfd0

Browse files
committed
Additional docs for base console command
1 parent 8e7593a commit 739bfd0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/cli/Command.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,14 @@ public function beforeAction($action)
113113

114114
/**
115115
* Executes a job.
116+
* The command is internal, and used to isolate a job execution. Manual usage is not provided.
116117
*
117118
* @param string|null $id of a message
118119
* @param int $ttr time to reserve
119120
* @param int $attempt number
120121
* @param int $pid of a worker
121122
* @return int exit code
123+
* @internal It is used with isolate mode.
122124
*/
123125
public function actionExec($id, $ttr, $attempt, $pid)
124126
{
@@ -163,7 +165,7 @@ protected function handleMessage($id, $message, $ttr, $attempt)
163165

164166
$process = new Process($cmd, null, null, $message, $ttr);
165167
try {
166-
$exitCode = $process->run(function ($type, $buffer) {
168+
$process->run(function ($type, $buffer) {
167169
if ($type === Process::ERR) {
168170
$this->stderr($buffer);
169171
} else {
@@ -175,6 +177,6 @@ protected function handleMessage($id, $message, $ttr, $attempt)
175177
return $this->queue->handleError($id, $job, $ttr, $attempt, $error);
176178
}
177179

178-
return $exitCode == ExitCode::OK;
180+
return $process->isSuccessful();
179181
}
180182
}

0 commit comments

Comments
 (0)