ソースを参照

评论存储时间

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 [