Du kan inte välja fler än 25 ämnen
Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
|
- <?php
-
- namespace App\Console\Commands;
-
-
- class HeartBeat extends BaseCommand
- {
-
- const COMMAND = "heartbeat {--maintenance}";
-
- protected bool $outputInfoForBase = false;
-
- /**
- * The name and signature of the console command.
- *
- * @var string
- */
- protected $signature = self::COMMAND;
-
- /**
- * The console command description.
- *
- * @var string
- */
- protected $description = 'ハートビート';
-
- static public function getCommand()
- {
- return self::COMMAND;
- }
-
-
- /**
- * Create a new command instance.
- *
- * @return void
- */
- public function __construct()
- {
- parent::__construct();
- }
-
- /**
- * Execute the console command.
- *
- * @return int
- */
- public function service(): int
- {
- if ($this->option('maintenance')) {
- $isMaintenanceMode = app()->isDownForMaintenance();
- if ($isMaintenanceMode) {
- $this->outputWarn("down for maintenance");
- }
- } else {
- $this->outputInfo("heart beat");
- }
- return self::RESULTCODE_SUCCESS;
- }
- }
|