| @@ 421-435 (lines=15) @@ | ||
| 418 | * |
|
| 419 | * @throws Exception |
|
| 420 | */ |
|
| 421 | protected function clearTube($tube, $state = 'ready') |
|
| 422 | { |
|
| 423 | $this->logger->info(sprintf('Clearing all jobs with the "%s" state in tube "%s"', $state, $tube)); |
|
| 424 | ||
| 425 | while ($job = $this->peek($tube, $state)) { |
|
| 426 | try { |
|
| 427 | $this->delete($job); |
|
| 428 | } catch (Exception $e) { |
|
| 429 | // job could have been deleted by another process |
|
| 430 | if (false === strpos($e->getMessage(), 'NOT_FOUND')) { |
|
| 431 | throw $e; |
|
| 432 | } |
|
| 433 | } |
|
| 434 | } |
|
| 435 | } |
|
| 436 | ||
| 437 | /** |
|
| 438 | * @param int $jobId |
|
| @@ 613-627 (lines=15) @@ | ||
| 610 | * |
|
| 611 | * @throws Exception |
|
| 612 | */ |
|
| 613 | protected function clearTube($tube, $state = 'ready') |
|
| 614 | { |
|
| 615 | $this->logger->info(sprintf('Clearing all jobs with the "%s" state in tube "%s"', $state, $tube)); |
|
| 616 | ||
| 617 | while ($job = $this->peek($tube, $state)) { |
|
| 618 | try { |
|
| 619 | $this->delete($job); |
|
| 620 | } catch (Exception $e) { |
|
| 621 | // job could have been deleted by another process |
|
| 622 | if (false === strpos($e->getMessage(), 'NOT_FOUND')) { |
|
| 623 | throw $e; |
|
| 624 | } |
|
| 625 | } |
|
| 626 | } |
|
| 627 | } |
|
| 628 | ||
| 629 | /** |
|
| 630 | * Returns a cached version of the payload resolver for an executor. |
|