Fix Health
ScheduleCheck
(#999)
* Use `ScheduleCheck` instead of a blank `Check`
This commit is contained in:
parent
35d25d216e
commit
8f47ccfbf7
@ -4,48 +4,11 @@ namespace App\Checks;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Composer\InstalledVersions;
|
||||
use Spatie\Health\Checks\Check;
|
||||
use Spatie\Health\Checks\Checks\ScheduleCheck as BaseCheck;
|
||||
use Spatie\Health\Checks\Result;
|
||||
|
||||
class ScheduleCheck extends Check
|
||||
class ScheduleCheck extends BaseCheck
|
||||
{
|
||||
protected string $cacheKey = 'health:checks:schedule:latestHeartbeatAt';
|
||||
|
||||
protected ?string $cacheStoreName = null;
|
||||
|
||||
protected int $heartbeatMaxAgeInMinutes = 1;
|
||||
|
||||
public function useCacheStore(string $cacheStoreName): self
|
||||
{
|
||||
$this->cacheStoreName = $cacheStoreName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCacheStoreName(): string
|
||||
{
|
||||
return $this->cacheStoreName ?? config('cache.default');
|
||||
}
|
||||
|
||||
public function cacheKey(string $cacheKey): self
|
||||
{
|
||||
$this->cacheKey = $cacheKey;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function heartbeatMaxAgeInMinutes(int $heartbeatMaxAgeInMinutes): self
|
||||
{
|
||||
$this->heartbeatMaxAgeInMinutes = $heartbeatMaxAgeInMinutes;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCacheKey(): string
|
||||
{
|
||||
return $this->cacheKey;
|
||||
}
|
||||
|
||||
public function run(): Result
|
||||
{
|
||||
$result = Result::make()->ok(trans('admin/health.results.schedule.ok'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user