Commit 1a94a3e8 authored by Dominik Hebeler's avatar Dominik Hebeler

Merge branch '937-use-redis-as-cache-backend' into 'development'

Resolve "Use Redis as Cache backend"

Closes #937

See merge request !1517
parents 53120678 969ff102
......@@ -15,7 +15,7 @@ REDIS_RESULT_CONNECTION=default
REDIS_RESULT_CACHE_DURATION=60
BROADCAST_DRIVER=log
CACHE_DRIVER=database
CACHE_DRIVER=redis
SESSION_DRIVER=file
QUEUE_CONNECTION=sync
......
<?php
namespace App\Console\Commands;
use DB;
use Illuminate\Console\Command;
class CacheGC extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'cache:gc';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Cleans up every expired cache File';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
DB::delete('delete from cache where cache.expiration < unix_timestamp()');
}
}
......@@ -27,7 +27,6 @@ class Kernel extends ConsoleKernel
{
$schedule->command('requests:gather')->everyFifteenMinutes();
$schedule->command('requests:useragents')->everyFiveMinutes();
$schedule->command('cache:gc')->hourly();
$schedule->call(function () {
DB::table('monthlyrequests')->truncate();
......
......@@ -69,8 +69,8 @@ return [
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'driver' => env('REDIS_CACHE_DRIVER', 'redis'),
'connection' => 'cache',
],
],
......
......@@ -118,6 +118,13 @@ return [
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
'cache' => [
'host' => env('REDIS_CACHE_HOST', 'localhost'),
'password' => env('REDIS_CACHE_PASSWORD', null),
'port' => env('REDIS_CACHE_PORT', 6379),
'database' => 0,
],
],
];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment