Commit 82343b50 authored by haoyanbin's avatar haoyanbin

Redis

parent 1af66c37
...@@ -491,8 +491,10 @@ func GetAllList(key string) map[string]string { ...@@ -491,8 +491,10 @@ func GetAllList(key string) map[string]string {
} }
func AppendConversationRecord(msg *SetMsgReq) { func AppendConversationRecord(msg *SetMsgReq) {
Redis.HSetNX("msg:"+strconv.Itoa(msg.ConversationId), StrCut(msg.Sender)+":"+StrCut(msg.Receiver)+":"+msg.SendTime, string(SerializeJson(msg))) data := *msg
//Redis.Set("msg:"+strconv.Itoa(msg.ConversationId),msg.SendTime,0) data.Sender = StrCut(data.Sender)
data.Receiver = StrCut(data.Receiver)
Redis.HSetNX("msg:"+strconv.Itoa(msg.ConversationId), data.Sender+":"+data.Receiver+":"+data.SendTime, string(SerializeJson(data)))
return return
} }
......
...@@ -46,7 +46,7 @@ func main() { ...@@ -46,7 +46,7 @@ func main() {
//ticker := time.NewTicker(time.Second * 10) //ticker := time.NewTicker(time.Second * 10)
//go func() { //go func() {
// for range ticker.C { // for range ticker.C {
// pool.SetEnd() // pool.SetDelConversation()
// } // }
//}() //}()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment