mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
update redis cache check
This commit is contained in:
parent
a78900fc69
commit
63e3ba259e
@ -84,7 +84,7 @@ class GithubReport
|
||||
$report->phpVersion = PHP_VERSION;
|
||||
|
||||
$report->redisRunning = false;
|
||||
if (env('CACHING') && env('CACHE_DRIVER') === 'redis') {
|
||||
if (env('CACHING') && strtolower(env('CACHE_DRIVER')) === 'redis') {
|
||||
try {
|
||||
$report->redisRunning = trim(app('redis')->ping()) === 'PONG' ? "Connected" : "Disconnected";
|
||||
} catch (ConnectionException $e) {
|
||||
|
@ -49,7 +49,7 @@ class MicroCaching
|
||||
if (
|
||||
!env('CACHING')
|
||||
|| !env('MICROCACHING')
|
||||
|| env('CACHE_DRIVER') !== 'redis'
|
||||
|| strtolower(env('CACHE_DRIVER')) !== 'redis'
|
||||
) {
|
||||
return $next($request);
|
||||
}
|
||||
|
@ -100,11 +100,8 @@ $app->routeMiddleware([
|
||||
|
|
||||
*/
|
||||
|
||||
if (env('CACHING')) {
|
||||
$app->configure('cache');
|
||||
$app->register(Illuminate\Redis\RedisServiceProvider::class);
|
||||
}
|
||||
|
||||
$app->configure('cache');
|
||||
$app->configure('database');
|
||||
$app->configure('queue');
|
||||
$app->configure('controller-to-table-mapping');
|
||||
@ -118,8 +115,9 @@ $app->register(\App\Providers\SourceHeartbeatProvider::class);
|
||||
$app->register(\App\Providers\EventServiceProvider::class);
|
||||
$app->register(Illuminate\Database\Eloquent\LegacyFactoryServiceProvider::class);
|
||||
$app->register(\App\Providers\AppServiceProvider::class);
|
||||
$app->register(Illuminate\Redis\RedisServiceProvider::class);
|
||||
|
||||
if (env('REPORTING') && env('REPORTING_DRIVER') === 'sentry') {
|
||||
if (env('REPORTING') && strtolower(env('REPORTING_DRIVER')) === 'sentry') {
|
||||
$app->register(\Sentry\Laravel\ServiceProvider::class);
|
||||
// Sentry Performance Monitoring (optional)
|
||||
$app->register(\Sentry\Laravel\Tracing\ServiceProvider::class);
|
||||
@ -130,13 +128,6 @@ if (env('REPORTING') && env('REPORTING_DRIVER') === 'sentry') {
|
||||
});
|
||||
}
|
||||
|
||||
// Guzzle removed as of lumen 8.x
|
||||
//$guzzleClient = new \GuzzleHttp\Client([
|
||||
// 'timeout' => env('SOURCE_TIMEOUT', 5),
|
||||
// 'connect_timeout' => env('SOURCE_CONNECT_TIMEOUT', 5)
|
||||
//]);
|
||||
//$app->instance('GuzzleClient', $guzzleClient);
|
||||
|
||||
$httpClient = \Symfony\Component\HttpClient\HttpClient::create(
|
||||
[
|
||||
'timeout' => env('SOURCE_TIMEOUT', 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user