From 436bd344cbf45732276e6839f2f2ac0192934400 Mon Sep 17 00:00:00 2001 From: Hamed Panjeh Date: Thu, 1 Feb 2024 18:37:52 -0300 Subject: [PATCH] Remove unused methods --- src/Http/Controllers/FailedJobsController.php | 56 +------------------ 1 file changed, 1 insertion(+), 55 deletions(-) diff --git a/src/Http/Controllers/FailedJobsController.php b/src/Http/Controllers/FailedJobsController.php index d4b1a36..c664ba2 100644 --- a/src/Http/Controllers/FailedJobsController.php +++ b/src/Http/Controllers/FailedJobsController.php @@ -11,7 +11,7 @@ class FailedJobsController extends Controller public function index(Request $request) { - $perPage = 50; + $perPage = 50; $failedJobs = DB::table('failed_jobs') ->orderBy('failed_at', 'desc') @@ -40,40 +40,6 @@ protected function decodeDatabaseFailedJob($job) return $job; } - - /** - * Paginate the failed jobs for the request. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Support\Collection - */ - protected function paginate(Request $request) - { - return $this->jobs->getFailed($request->query('starting_at') ?: -1)->map(function ($job) { - return $this->decode($job); - }); - } - - /** - * Paginate the failed jobs for the request and tag. - * - * @param \Illuminate\Http\Request $request - * @param string $tag - * @return \Illuminate\Support\Collection - */ - protected function paginateByTag(Request $request, $tag) - { - $jobIds = $this->tags->paginate( - 'failed:'.$tag, ($request->query('starting_at') ?: -1) + 1, 50 - ); - - $startingAt = $request->query('starting_at', 0); - - return $this->jobs->getJobs($jobIds, $startingAt)->map(function ($job) { - return $this->decode($job); - }); - } - public function show($uuid) { $failedJob = DB::table('failed_jobs')->where('uuid', $uuid)->first(); @@ -98,24 +64,4 @@ protected function decodeDatabaseJob($job) return $job; } - - /** - * Decode the given job. - * - * @param object $job - * @return object - */ - protected function decode($job) - { - $job->payload = json_decode($job->payload); - - $job->exception = mb_convert_encoding($job->exception, 'UTF-8'); - - $job->context = json_decode($job->context); - - $job->retried_by = collect(json_decode($job->retried_by)) - ->sortByDesc('retried_at')->values(); - - return $job; - } }