浏览代码

评论存储时间

wzq 5 年之前
父节点
当前提交
01cc8018b9
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      app/Traits/PostTrait.php
  2. 1 1
      app/Transformers/Post/CommentTransformer.php

+ 1 - 1
app/Traits/PostTrait.php

@@ -100,7 +100,7 @@ trait PostTrait
                 ];
             }
             Redis::SET($commentKey, json_encode($comment));
-            Redis::EXPIRE($commentKey, 300);
+            Redis::EXPIRE($commentKey, 604800);
         }
         return $comment;
     }

+ 1 - 1
app/Transformers/Post/CommentTransformer.php

@@ -43,7 +43,7 @@ class CommentTransformer extends TransformerAbstract
                 ];
             }
             Redis::SET($replyKey, json_encode($reply));
-            Redis::EXPIRE($replyKey, 300);
+            Redis::EXPIRE($replyKey, 604800);
         }
         $user = $this->userInfo($postComment['uid']);
         return [