using StackExchange.Redis;
namespace Redis
{
public class Client
{
public static readonly ConnectionMultiplexer redis = ConnectionMultiplexer.Connect(new ConfigurationOptions()
{
EndPoints = { "localhost" }
}
);
public static double Ping()
{
var db = redis.GetDatabase();
var ping = db.Ping();
return ping.TotalMilliseconds;
}
}
}
Whenever i call redis.GetDatabase()
I get the error "It was not possible to connect to the redis server(s) right now".