🐛 The number of links pending checks did not exclude links that have health checks disabled

This commit is contained in:
Erik Yeoh 2020-09-03 14:36:45 +08:00
parent 6cac1a7fb7
commit 2ec3168f91
1 changed files with 5 additions and 2 deletions

View File

@ -62,8 +62,11 @@ class HealthCheckStats
public function countPending()
{
return \DB::table('links')
->where('http_checked_at', '<', now()->subDays(app(Shaark::class)->getLinkHealthChecksAge()))
->orWhereNull('http_checked_at')
->where('is_health_check_enabled', 1)
->where(function ($query) {
return $query->where('http_checked_at', '<', now()->subDays(app(Shaark::class)->getLinkHealthChecksAge()))
->orWhereNull('http_checked_at');
})
->count();
}