update redis cache check

This commit is contained in:
Irfan 2022-12-03 03:06:12 +05:00
parent a78900fc69
commit 63e3ba259e
3 changed files with 5 additions and 14 deletions

View File

@ -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) {

View File

@ -49,7 +49,7 @@ class MicroCaching
if (
!env('CACHING')
|| !env('MICROCACHING')
|| env('CACHE_DRIVER') !== 'redis'
|| strtolower(env('CACHE_DRIVER')) !== 'redis'
) {
return $next($request);
}

View File

@ -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)