Skip to content

Commit

Permalink
Merge pull request #11 from uafrica/fix-requeue
Browse files Browse the repository at this point in the history
Fix requeue
  • Loading branch information
dakota committed Aug 10, 2017
2 parents 50e8a8e + 4794ba3 commit 021e5cd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Shell/WatchdogShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,11 @@ public function requeue()
->get($this->args[0]);

if ($job->status === Job::STATUS_NEW || $job->status === Job::STATUS_FAILED) {
$job->queue();
if (JobManager::instance()->enqueuePersisted($job['id'], $job['priority'])) {
$this->out(' :: <success>√</success>', 1, Shell::VERBOSE);
} else {
$this->out(' :: <error>X</error>', 1, Shell::VERBOSE);
}
$this->out(__('<success>{0} has been queued</success>', $job->id));
} else {
$this->out(__('<error>{0} could not be queued</error>', $job->id));
Expand All @@ -377,7 +381,7 @@ public function revive()
$stats = JobManager::instance()->getMessageBroker()->queueStatus();
if ($stats['messages'] > 0) {
$this->out(__('<error>There are {0} messages currently queued</error>', $stats['messages']));
$this->out('We cannot reliablily determine which messages to requeue unless the RabbitMQ queue is empty.');
$this->out('We cannot reliably determine which messages to requeue unless the RabbitMQ queue is empty.');
$this->_stop(1);
}

Expand Down Expand Up @@ -474,7 +478,7 @@ public function getOptionParser()
'help' => 'Requeues all new or failed jobs that should be in RabbitMQ'
])
->addSubcommand('requeue', [
'help ' => 'Receues a job',
'help ' => 'Requeues a job',
'parser' => [
'arguments' => [
'id' => [
Expand Down

0 comments on commit 021e5cd

Please sign in to comment.