mirror of
https://github.com/idanoo/laravel-resque.git
synced 2024-11-21 08:01:59 +00:00
make it configurable which redis config to use
This commit is contained in:
parent
17f9d2a176
commit
479e441d29
@ -2,6 +2,15 @@
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Redis Config
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('RESQUE_REDIS', 'resque'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Prefix
|
||||
@ -9,6 +18,6 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'prefix' => env('RESQUE_PREFIX', 'resque'),
|
||||
'prefix' => 'lethe_' . env('APP_ID'),
|
||||
|
||||
];
|
||||
|
@ -48,7 +48,11 @@ class ResqueServiceProvider extends ServiceProvider
|
||||
|
||||
protected function setRedisConfig()
|
||||
{
|
||||
$config = $this->app['config']['database.redis.default'];
|
||||
$default = $this->app['config']['resque.default'];
|
||||
$config = $this->app['config'][sprintf('database.redis.%s', $default)];
|
||||
if (!$config) {
|
||||
$config = $this->app['config']['database.redis.default'];
|
||||
}
|
||||
|
||||
$host = isset($config['host']) ? $config['host'] : 'localhost';
|
||||
$port = isset($config['port']) ? $config['port'] : 6379;
|
||||
|
Loading…
Reference in New Issue
Block a user