ctstone/csredis

async methods not working?

Closed this issue · 4 comments

I'm trying to use HIncrByFloatAsync method;

var test =_client.HIncrByFloatAsync(currentKey, share.Miner.Username, share.Difficulty).Result;

And this doesn't thrown an exception (it should be doing so as I'm trying to set a non valid value)

But non-async seems to throw the exception i expect correctly

var test =_client.HIncrByFloat(currentKey, share.Miner.Username, share.Difficulty);

The error I expect;

ERR value is not a valid float

and strangely i've found that i'm supplying a string, another string and a double but getting;

ERR value is not a valid float

Further tracked down the problem;

HashTests.HIncrByFloat fails;

Test method CSRedis.Tests.HashTests.TestHIncrByFloat threw exception: 
System.FormatException: Input string was not in a correct format.
    at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
   at System.Double.Parse(String s, NumberStyles style)
   at CSRedis.Internal.Commands.RedisFloat.FromString(String input) in RedisFloat.cs: line 21
   at CSRedis.Internal.Commands.RedisFloat.Parse(RedisReader reader) in RedisFloat.cs: line 16
   at CSRedis.Internal.RedisConnection.Call(RedisCommand`1 command) in RedisConnection.cs: line 89
   at CSRedis.RedisClient.Write(RedisCommand`1 command) in RedisClient.Sync.cs: line 37
   at CSRedis.RedisClient.HIncrByFloat(String key, String field, Double increment) in RedisClient.Sync.cs: line 487
   at CSRedis.Tests.HashTests.TestHIncrByFloat() in HashTests.cs: line 95


PR #15 fixes the tests problems;

Seems to work fine.