jikan-rest/app/Providers/SourceHealthServiceProvider.php

29 lines
637 B
PHP
Raw Normal View History

<?php
namespace App\Providers;
use Illuminate\Support\Facades\Storage;
use Laravel\Lumen\Providers\EventServiceProvider as ServiceProvider;
class SourceHealthServiceProvider extends ServiceProvider
{
const BAD_HEALTH_STATUSES = [403, 500, 501, 502, 503, 504, 505];
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
2020-09-13 12:52:15 +05:00
'App\Events\SourceHeartbeatEvent' => [
'App\Listeners\SourceHealthListener',
],
];
public static function isFailoverEnabled() : bool
{
return Storage::exists('source_failover.lock');
}
}