Refactor check data

This commit is contained in:
Hillel Coren 2017-08-30 15:24:01 +03:00
parent 207ca28a46
commit 1af20bd955

View File

@ -382,19 +382,14 @@ class CheckData extends Command
return; return;
} }
$current = config('database.default');
$queueDB = config('queue.connections.database.connection'); $queueDB = config('queue.connections.database.connection');
config(['database.default' => $queueDB]); $count = DB::connection($queueDB)->table('failed_jobs')->count();
$count = DB::table('failed_jobs')->count();
if ($count > 0) { if ($count > 0) {
$this->isValid = false; $this->isValid = false;
} }
$this->logMessage($count . ' failed jobs'); $this->logMessage($count . ' failed jobs');
config(['database.default' => $current]);
} }
private function checkBlankInvoiceHistory() private function checkBlankInvoiceHistory()