File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ class Queue extends BaseConfig
55
55
*/
56
56
public array $ redis = [
57
57
'host ' => '127.0.0.1 ' ,
58
+ 'username ' => null ,
58
59
'password ' => null ,
59
60
'port ' => 6379 ,
60
61
'timeout ' => 0 ,
Original file line number Diff line number Diff line change @@ -41,8 +41,10 @@ public function __construct(protected QueueConfig $config)
41
41
throw new CriticalError ('Queue: Redis connection failed. Check your configuration. ' );
42
42
}
43
43
44
- if (isset ($ config ->redis ['password ' ]) && ! $ this ->redis ->auth ($ config ->redis ['password ' ])) {
45
- throw new CriticalError ('Queue: Redis authentication failed. ' );
44
+ if (!empty ($ config ->redis ['username ' ]) && !empty ($ config ->redis ['password ' ]) && !$ this ->redis ->auth ([$ config ->redis ['username ' ], $ config ->redis ['password ' ]])) {
45
+ throw new CriticalError ('Queue: Redis authentication failed. Check your username and password. ' );
46
+ } elseif (!empty ($ config ->redis ['password ' ]) && !$ this ->redis ->auth ($ config ->redis ['password ' ])) {
47
+ throw new CriticalError ('Queue: Redis authentication failed. Check your password. ' );
46
48
}
47
49
48
50
if (isset ($ config ->redis ['database ' ]) && ! $ this ->redis ->select ($ config ->redis ['database ' ])) {
You can’t perform that action at this time.
0 commit comments