From 392bfa7c2516cb2093a1442687245f57b4864bfb Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 21 Feb 2017 19:54:00 +0200 Subject: [PATCH] Check failed_jobs is empty in check-data --- app/Console/Commands/CheckData.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index db8a85266ad5..8f728290289a 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -69,6 +69,7 @@ class CheckData extends Command $this->checkBalances(); if (! $this->option('client_id')) { + $this->checkFailedJobs(); $this->checkAccountData(); } @@ -91,6 +92,17 @@ class CheckData extends Command $this->log .= $str . "\n"; } + private function checkFailedJobs() + { + $count = DB::table('failed_jobs')->count(); + + if ($count > 0) { + $this->isValid = false; + } + + $this->logMessage($count . ' failed jobs'); + } + private function checkBlankInvoiceHistory() { $count = DB::table('activities')