开发者

NorthscaleClient does not Set values consistently

I am using NorthscaleClient from Enyim Memcached client libary to store objects in Northscale Memcached Server. Below does not wor开发者_JS百科k consistently, assertion fails most of the time. Am I doing anything wrong?

        // File size is 360kb
        var reader = File.ReadAllText(@"c:\RHDSetup.log");
        for (int i = 0; i < 10; i++)
        {
            Assert.True(new NorthScaleClient(c).Store(StoreMode.Set, i.ToString(),
                                reader));

            Thread.Sleep(1000);
        }


The problem was the usage of new NorthScaleClient(c).Store(StoreMode.Set, i.ToString(), reader) inside Assert.True method. After removing inline call and initializing it outside works well. I guess, it is probably sometimes the object goes out of scope and assertion fails.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜