oved-php / health-checks Goto Github PK
View Code? Open in Web Editor NEWLaravel health checker
License: MIT License
Laravel health checker
License: MIT License
It would make a log of sense for this to have Lumen integration to have API health...
Should maybe be use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
For queue helth check:
Whoops\Exception\ErrorException : Class PhpSafari\Jobs\CheckQueueIsRunning contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Illuminate\Queue\Jobs\Job::getJobId)
I added this implementation to stop this error:
public function getJobId() { }
Thank you.
The way that health checks are set up in the config breaks the functionality of php artisan config:cache
The issue is how the following gets cached onto bootstrap/cache/config.php
'checks' => [
new DatabaseOnline(),
new DatabaseUpToDate(),
new DebugModeOff(),
new LogLevel('error'),
]
The generated cache breaks the site during bootstrap since it requires more dependencies to be present. My work around was to modify the constructor of the CheckList.php to instantiate the classes based on the type.
<?php
namespace PhpSafari\Utils;
use PhpSafari\Checks\HealthCheck;
use Vistik\Collections\TypedCollection;
class CheckList extends TypedCollection
{
public function __construct($checks)
{
$cast = function ($check) {
if ($check instanceof HealthCheck) return $check;
if (is_string($check)) return new $check;
if (is_array($check)) return new $check[0](...array_slice($check, 1));
};
parent::__construct(array_map($cast, $checks));
}
protected $type = HealthCheck::class;
}
So now in my health.php I can do
'checks' => [
DatabaseOnline::class,
[PathIsWritable::class, storage_path()],
[PathIsWritable::class, storage_path('logs')],
[PathIsWritable::class, storage_path('framework/sessions')],
[PathIsWritable::class, storage_path('framework/cache')],
],
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.