From 9c9e86a699e99dddddae00c5e2ec60f29f034ab1 Mon Sep 17 00:00:00 2001 From: "pzrr@qq.com" Date: Thu, 10 May 2018 10:38:30 +0800 Subject: [PATCH] ignore session_update_redis panic error --- session/store_redis.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/session/store_redis.go b/session/store_redis.go index 44b8c97..54857ad 100644 --- a/session/store_redis.go +++ b/session/store_redis.go @@ -65,6 +65,12 @@ func (store *RedisStore) SessionExist(sessionId string) bool { //SessionUpdate update session state in store func (store *RedisStore) SessionUpdate(state *SessionState) error { + defer func(){ + //ignore error + if err := recover(); err != nil { + //TODO deal panic err + } + }() redisClient := redisutil.GetRedisClient(store.serverIp) bytes, err := gob.EncodeMap(state.values) if err != nil {