where('payload', 'like', '{"displayName":"App\\\\\\\\Jobs\\\\\\\\SendReplyToCustomer"%') ->where('available_at', '<', time() - self::CHECK_PERIOD) ->exists(); // Check failed_jobs. // No need - it can be done via Manage > Alerts > Logs Monitoring // if (!$pending_jobs) { // $pending_jobs = \App\FailedJob::where('queue', 'emails') // ->where('payload', 'like', '{"displayName":"App\\\\\\\\Jobs\\\\\\\\SendReplyToCustomer"%') // ->where('created_at', '<', time() - self::CHECK_PERIOD) // ->exists(); // } if ($pending_jobs) { \Option::set('send_emails_problem', '1'); $this->error('['.date('Y-m-d H:i:s').'] There are problems with emails queue processing'); } else { \Option::remove('send_emails_problem'); $this->info('['.date('Y-m-d H:i:s').'] Emails queue processing is working'); } } }