Save workspace changes
This commit is contained in:
25
app/Console/Commands/HealthSchedulerTickCommand.php
Normal file
25
app/Console/Commands/HealthSchedulerTickCommand.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Redis;
|
||||
use Throwable;
|
||||
|
||||
class HealthSchedulerTickCommand extends Command
|
||||
{
|
||||
protected $signature = 'health:tick';
|
||||
protected $description = 'Write a scheduler heartbeat timestamp to Redis for health:check --only=scheduler.';
|
||||
|
||||
public function handle(): int
|
||||
{
|
||||
try {
|
||||
Redis::setex('health:scheduler_last_tick', 300, time());
|
||||
} catch (Throwable $e) {
|
||||
// Non-fatal — never block the scheduler.
|
||||
$this->warn('health:tick could not write to Redis: ' . $e->getMessage());
|
||||
}
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user