mirror of
https://github.com/minetest/minetestmapper.git
synced 2024-12-26 02:40:37 +01:00
Add support for Redis via UNIX domain sockets (#46)
This commit is contained in:
parent
25d1d43004
commit
6afe1b78c5
@ -53,7 +53,7 @@ DBRedis::DBRedis(const std::string &mapdir)
|
|||||||
}
|
}
|
||||||
const char *addr = tmp.c_str();
|
const char *addr = tmp.c_str();
|
||||||
int port = stoi64(get_setting_default("redis_port", ifs, "6379"));
|
int port = stoi64(get_setting_default("redis_port", ifs, "6379"));
|
||||||
ctx = redisConnect(addr, port);
|
ctx = tmp.find('/') != std::string::npos ? redisConnectUnix(addr) : redisConnect(addr, port);
|
||||||
if(!ctx)
|
if(!ctx)
|
||||||
throw std::runtime_error("Cannot allocate redis context");
|
throw std::runtime_error("Cannot allocate redis context");
|
||||||
else if(ctx->err) {
|
else if(ctx->err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user