Browse Source

评论存储时间

wzq 5 years ago
parent
commit
01cc8018b9
2 changed files with 2 additions and 2 deletions
  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 [