Эх сурвалжийг харах

Merge branch 'master' of ssh://192.168.3.207:10022/jianyu/jy-docs

cuiyalong 4 жил өмнө
parent
commit
7964726bbc

+ 3 - 1
jydocs-back/public/db.go

@@ -103,7 +103,9 @@ func OpenShareJydoc(fromId, openId, docId string) {
 	}) == 0 {
 		return
 	}
-	if redis.Get("other", fmt.Sprintf("integral_article_%s_%s", fromId, docId)) == nil {
+	key := fmt.Sprintf("integral_article_%s_%s_%s", docId, fromId, openId)
+	if redis.Incr("other", key) == 1 {
+		_ = redis.SetExpire("other", key, 24*60*60)
 		pushErr := func() error {
 			b, _ := json.Marshal(&model.Message{
 				E_code:   "jydocs_doc_open",