Skip to content

Commit

Permalink
Remove unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
HPWebdeveloper committed Feb 1, 2024
1 parent 4dfa3dd commit 436bd34
Showing 1 changed file with 1 addition and 55 deletions.
56 changes: 1 addition & 55 deletions src/Http/Controllers/FailedJobsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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();
Expand All @@ -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;
}
}

0 comments on commit 436bd34

Please sign in to comment.