aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/database-redis.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/database-redis.cpp b/src/database-redis.cpp
index 3bcedad9b..3df186944 100644
--- a/src/database-redis.cpp
+++ b/src/database-redis.cpp
@@ -44,7 +44,8 @@ Database_Redis::Database_Redis(Settings &conf)
}
const char *addr = tmp.c_str();
int port = conf.exists("redis_port") ? conf.getU16("redis_port") : 6379;
- ctx = redisConnect(addr, port);
+ // if redis_address contains '/' assume unix socket, else hostname/ip
+ ctx = tmp.find('/') != std::string::npos ? redisConnectUnix(addr) : redisConnect(addr, port);
if (!ctx) {
throw DatabaseException("Cannot allocate redis context");
} else if (ctx->err) {