From 291755a48b4a5d5f77654ccc9e62a1020bd68a4d Mon Sep 17 00:00:00 2001 From: wangwei01 Date: Mon, 29 Jul 2019 14:29:37 +0800 Subject: [PATCH] =?UTF-8?q?redis=E6=B7=BB=E5=8A=A0=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- third_party/phpcommon | 2 +- webapp/controller/RankController.class.php | 2 +- webapp/controller/ShopController.class.php | 2 ++ webapp/controller/TeamController.class.php | 5 ++++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/third_party/phpcommon b/third_party/phpcommon index 21cbf16..5fb5d7f 160000 --- a/third_party/phpcommon +++ b/third_party/phpcommon @@ -1 +1 @@ -Subproject commit 21cbf1616cd145c248452eaf77b1e1c7c14c82bd +Subproject commit 5fb5d7f6fcd174b9c4ad4e30e189e90e2b8c846e diff --git a/webapp/controller/RankController.class.php b/webapp/controller/RankController.class.php index a6b73cc..da94f64 100644 --- a/webapp/controller/RankController.class.php +++ b/webapp/controller/RankController.class.php @@ -70,7 +70,7 @@ class RankController{ 'win_game' => $row['win_times'] )); } - + ini_set('memory_limit','3072M'); //击杀榜 $r = $this->getRedis(); $kill_rank_db = $r->get("game2001api: kill_rank"); diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index be53dd8..f78c655 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -200,6 +200,7 @@ class ShopController{ } } $r->set($shop_uuid, json_encode($user_db)); + $r -> pexpire($shop_uuid, 1000 * 3600 * 24); //增加奖励 $addreward = new classes\AddReward(); $addreward->addReward($item_id, $item_num, $account_id); @@ -269,6 +270,7 @@ class ShopController{ $shop_list = $this->randomShop(); $user_db['shop_list'] = $shop_list; $r -> set($shop_uuid, json_encode($user_db)); + $r -> pexpire($shop_uuid, 1000 * 3600 * 24); echo json_encode(array( 'errcode' => 0, 'errmsg'=> '', diff --git a/webapp/controller/TeamController.class.php b/webapp/controller/TeamController.class.php index 2daae7b..b65b233 100644 --- a/webapp/controller/TeamController.class.php +++ b/webapp/controller/TeamController.class.php @@ -128,7 +128,7 @@ class TeamController{ 'avatar_url' => $_REQUEST['avatar_url'], )); $r->set(TEAMID_KEY . $team_uuid, json_encode($user_db)); - + $r -> pexpire(TEAMID_KEY . $team_uuid, 1000 * 600); echo json_encode(array( 'errcode' => 0, 'errmsg' => '', @@ -179,6 +179,7 @@ class TeamController{ } $r->set(TEAMID_KEY . $team_uuid, json_encode($user_db)); + $r -> pexpire(TEAMID_KEY . $team_uuid, 1000 * 600); } echo json_encode(array( 'errcode' => 0, @@ -221,6 +222,7 @@ class TeamController{ } $r->set(TEAMID_KEY . $team_uuid, json_encode($user_db)); + $r -> pexpire(TEAMID_KEY . $team_uuid, 1000 * 600); if (count($user_db['member_list']) == 0) { $r->del(TEAMID_KEY . $team_uuid, json_encode($user_db)); } @@ -260,6 +262,7 @@ class TeamController{ } $user_db['auto_fill'] = $_REQUEST['auto_fill']; $r->set(TEAMID_KEY . $team_uuid, json_encode($user_db)); + $r -> pexpire(TEAMID_KEY . $team_uuid, 1000 * 600); } echo json_encode(array( 'errcode' => 0,