https://github.com/MichaCo/CacheManager/issues/42
Hi. I'm using Redis4You hosted redis server. And the following configuration works fine. When the code comes to line Cache.Add("a", "b");
, then it stucks there for an infinite time. When I monitor the Redis server I see the console with full of PING there.
static class Program
{
static readonly ICacheManager<string> Cache = CacheFactory.Build<string>("Test", cbcp =>
{
cbcp.WithSystemRuntimeCacheHandle("testCache")
.And
.WithRedisConfiguration("redis", rcb =>
{
rcb.WithEndpoint("<XXX>", 1111)
.WithPassword("<YYY>")
.WithAllowAdmin()
.WithDatabase(1);
})
.WithMaxRetries(100)
.WithRetryTimeout(10)
.WithRedisBackPlate("redis")
.WithRedisCacheHandle("redis", true);
});
static void Main(string[] args)
{
/* It stucks in the first line. */
Cache.Add("a", "b");
Console.ReadLine();
}
}
I debugged the code and the LuaScripts provided by CacheManager library such as the one below causes an error:
local result=redis.call('HMSET', KEYS[1], 'value', ARGV[1], 'type', ARGV[2], 'expiration', ARGV[3], 'timeout', ARGV[4], 'created', ARGV[5])
if ARGV[3] ~= '0' and ARGV[4] ~= '0' then
redis.call('PEXPIRE', KEYS[1], ARGV[4])
else
redis.call('PERSIST', KEYS[1])
end
return result
... and this luascript is used on this part of code in CacheManager library RedisCacheHandler.cs LoadScripts() method;
var putLua = StackRedis.LuaScript.Prepare(ScriptPut);
putLua.Load(server);
So, What is the problem here? (I don't think it's the version because redis4you uses 2.4 and redislab uses 3.0.3 of redis.)