Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ REDIS_PASSWORD=null
REDIS_PORT=6379
REDIS_SCHEME=tcp
REDIS_DB=0
REDIS_PREFIX=your_prefix
```

Update composer.json
Expand Down
3 changes: 2 additions & 1 deletion examples/.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ REDIS_CLIENT=predis
REDIS_PASSWORD=null
REDIS_PORT=6379
REDIS_SCHEME=tcp
REDIS_DB=0
REDIS_DB=0
REDIS_PREFIX=myproject
2 changes: 1 addition & 1 deletion examples/application/controllers/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function work() {
$options = new Illuminate\Queue\WorkerOptions();
$options->maxTries = 5;
$options->timeOut = 300;
$worker->daemon('redis', 'default', $options);
$worker->daemon('redis', $_ENV['REDIS_PREFIX'], $options);
}

}
10 changes: 5 additions & 5 deletions src/Libraries/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace Masrodjie\Queue\Libraries;

use Illuminate\Queue\Worker;
use Illuminate\Container\Container;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Illuminate\Database\Capsule\Manager;
use Illuminate\Events\Dispatcher;
use Illuminate\Queue\Capsule\Manager as QueueManager;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Illuminate\Container\Container;
use Illuminate\Queue\Worker;
use Illuminate\Queue\WorkerOptions;
use Illuminate\Redis\RedisManager;
use Illuminate\Database\Capsule\Manager;

class Queue
{
Expand All @@ -23,7 +23,7 @@ public function __construct()
'queue.connections.redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => 'default',
'queue' => getenv('REDIS_PREFIX') != '' ? getenv('REDIS_PREFIX') : $_ENV['REDIS_PREFIX'],
'retry_after' => 30,
],
'queue.default' => 'redis',
Expand Down