We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d34f149 commit f83d868Copy full SHA for f83d868
src/database-redis.cpp
@@ -53,6 +53,18 @@ Database_Redis::Database_Redis(Settings &conf)
53
redisFree(ctx);
54
throw DatabaseException(err);
55
}
56
+ if (conf.exists("redis_password")) {
57
+ tmp = conf.get("redis_password");
58
+ redisReply *reply = static_cast<redisReply *>(redisCommand(ctx, "AUTH %s", tmp.c_str()));
59
+ if (!reply)
60
+ throw DatabaseException("Redis authentication failed");
61
+ if (reply->type == REDIS_REPLY_ERROR) {
62
+ std::string err = "Redis authentication failed: " + std::string(reply->str, reply->len);
63
+ freeReplyObject(reply);
64
+ throw DatabaseException(err);
65
+ }
66
67
68
69
70
Database_Redis::~Database_Redis()
0 commit comments