Differential D21532 Diff 51259 src/applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | final protected function doWork() { | ||||
$commit = $this->loadCommit(); | $commit = $this->loadCommit(); | ||||
$repository = $commit->getRepository(); | $repository = $commit->getRepository(); | ||||
$this->repository = $repository; | $this->repository = $repository; | ||||
$this->parseCommit($repository, $this->commit); | $this->parseCommit($repository, $this->commit); | ||||
} | } | ||||
final protected function shouldQueueFollowupTasks() { | private function shouldQueueFollowupTasks() { | ||||
return !idx($this->getTaskData(), 'only'); | return !idx($this->getTaskData(), 'only'); | ||||
} | } | ||||
final protected function queueCommitTask($task_class) { | |||||
if (!$this->shouldQueueFollowupTasks()) { | |||||
return; | |||||
} | |||||
$commit = $this->loadCommit(); | |||||
$repository = $commit->getRepository(); | |||||
$data = array( | |||||
'commitID' => $commit->getID(), | |||||
); | |||||
$task_data = $this->getTaskData(); | |||||
if (isset($task_data['via'])) { | |||||
$data['via'] = $task_data['via']; | |||||
} | |||||
$options = array( | |||||
// We queue followup tasks at default priority so that the queue finishes | |||||
// work it has started before starting more work. If followups are queued | |||||
// at the same priority level, we do all message parses first, then all | |||||
// change parses, etc. This makes progress uneven. See T11677 for | |||||
// discussion. | |||||
'priority' => parent::PRIORITY_DEFAULT, | |||||
'objectPHID' => $commit->getPHID(), | |||||
'containerPHID' => $repository->getPHID(), | |||||
); | |||||
$this->queueTask($task_class, $data, $options); | |||||
} | |||||
protected function getImportStepFlag() { | protected function getImportStepFlag() { | ||||
return null; | return null; | ||||
} | } | ||||
final protected function shouldSkipImportStep() { | final protected function shouldSkipImportStep() { | ||||
// If this step has already been performed and this is a "natural" task | // If this step has already been performed and this is a "natural" task | ||||
// which was queued by the normal daemons, decline to do the work again. | // which was queued by the normal daemons, decline to do the work again. | ||||
// This mitigates races if commits are rapidly deleted and revived. | // This mitigates races if commits are rapidly deleted and revived. | ||||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |