Commit 7e87ca51 authored by Dillenn Terumalai's avatar Dillenn Terumalai
Browse files

refactor: ordering jobs by id and desc

parent 98c28b87
Pipeline #2361 passed with stage
in 6 seconds
......@@ -98,6 +98,7 @@ class DatabaseJobRepository implements JobRepository
public function pendingJobs(): Collection
{
return JobModel::whereNull(['cancelled_at', 'failed_at', 'completed_at'])
->orderBy('id', 'desc')
->get();
}
......@@ -109,6 +110,7 @@ class DatabaseJobRepository implements JobRepository
public function completedJobs(): Collection
{
return JobModel::whereNotNull('completed_at')
->orderBy('id', 'desc')
->get();
}
......@@ -120,6 +122,7 @@ class DatabaseJobRepository implements JobRepository
public function failedJobs(): Collection
{
return JobModel::whereNotNull('failed_at')
->orderBy('id', 'desc')
->get();
}
......@@ -131,6 +134,7 @@ class DatabaseJobRepository implements JobRepository
public function cancelledJobs(): Collection
{
return JobModel::whereNotNull('cancelled_at')
->orderBy('id', 'desc')
->get();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment