私はBooksleeve 1.1.0.6(最新のナゲットパッケージ)を使用しています。BooksleeveでRedisConnectionを格納するためにシングルトンを使用する方法?
私はので、私はシングルトンに格納しています私の全体のWebアプリケーションのための単一の接続を使用したい:
public static RedisConnection Conn = RedisConfig.GetUnsecuredConnection(waitForOpen: true);
RedisConfig.GetUnsecuredConnection方法はBookSleeve・テストで使用したものと同じです。私は運転をしようとすると
私はInvalidOperationExceptionが出る:キューが閉じている例外:
[InvalidOperationExceptionが:キューが閉じられている] BookSleeve.MessageQueue.Enqueue(RedisMessage項目、ブールhighPri C:\ Dev \ BookSleeve \ BookSleeve \ ReducedConnectionBase.csのBookSleeve.RedisConnectionBase.ExecuteVoid(RedisMessageメッセージ、ブールqueueJump):794 ASP.welisten_booksleevetests_aspx.SaveDictionaryToRedis (辞書2辞書)+173 ASP.welisten_bo oksleevetests_aspx.Page_Load(Object sender、EventArgs e)+67 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp、Object o、Object t、EventArgs e)+25 System.Web.UI.Control.LoadRecursive()+ 71 System.Web.UI.Page.ProcessRequestMain(ブールincludeStagesBeforeAsyncPoint、ブールのincludeStagesAfterAsyncPoint)3064
私は真に設定waitForOpenパラメータでこれを試み、
偽ここでは、コードされ実行しようとしています:
接続を開き、さまざまなハンドシェイクを実行しますtheConnection.Open();
:
private void SaveDictionaryToRedis(Dictionary<string, string> dictionary)
{
using (Mp.Step("Saving Data to Redis"))
{
using (RedisConfig.Conn)
{
RedisConfig.Conn.Strings.Set(DB, dictionary);
}
}
}