company->db); /** @var \App\Export\CSV\CreditExport $export */ $export = new $this->report_class($this->company, $this->request); if (isset($this->request['output']) && $this->request['output'] == 'json') { $report = $export->returnJson(); } else { $report = $export->run(); } Cache::put($this->hash, $report, 60 * 60); } // public function middleware() // { // return [ // (new WithoutOverlapping("report-{$this->company->company_key}-{$this->report_class}")) // ->releaseAfter(60) // ->expireAfter(60) // 5 minutes // ->dontRelease(), // This prevents the job from being marked as a "release" which counts towards attempts // ]; // } /** * Handle a job failure. */ public function failed(\Throwable $exception = null) { if($exception) { nlog("EXCEPTION:: PreviewReport:: could not preview report for" . $exception->getMessage()); } } }