Skip to content

Commit

Permalink
Use password directly when connecting to Redis (#903)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomaSajt committed Nov 7, 2023
1 parent 95c3cee commit 1711b39
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/LANraragi/Model/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,14 @@ sub get_redis_internal {

# Default redis server location is localhost:6379.
# Auto-reconnect on, one attempt every 2ms up to 3 seconds. Die after that.
# Auth if password is set
my $redis = Redis->new(
server => &get_redisad,
debug => $ENV{LRR_DEVSERVER} ? "1" : "0",
reconnect => 3
reconnect => 3,
&get_redispassword ? (password => &get_redispassword) : ()
);

# Auth if password is set
if ( &get_redispassword ne "" ) {
$redis->auth(&get_redispassword);
}

# Switch to specced database
$redis->select($db);
return $redis;
Expand Down

0 comments on commit 1711b39

Please sign in to comment.