redis添加定时删除时间
This commit is contained in:
parent
72ffbf1a85
commit
291755a48b
2
third_party/phpcommon
vendored
2
third_party/phpcommon
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 21cbf1616cd145c248452eaf77b1e1c7c14c82bd
|
Subproject commit 5fb5d7f6fcd174b9c4ad4e30e189e90e2b8c846e
|
@ -70,7 +70,7 @@ class RankController{
|
|||||||
'win_game' => $row['win_times']
|
'win_game' => $row['win_times']
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
ini_set('memory_limit','3072M');
|
||||||
//击杀榜
|
//击杀榜
|
||||||
$r = $this->getRedis();
|
$r = $this->getRedis();
|
||||||
$kill_rank_db = $r->get("game2001api: kill_rank");
|
$kill_rank_db = $r->get("game2001api: kill_rank");
|
||||||
|
@ -200,6 +200,7 @@ class ShopController{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$r->set($shop_uuid, json_encode($user_db));
|
$r->set($shop_uuid, json_encode($user_db));
|
||||||
|
$r -> pexpire($shop_uuid, 1000 * 3600 * 24);
|
||||||
//增加奖励
|
//增加奖励
|
||||||
$addreward = new classes\AddReward();
|
$addreward = new classes\AddReward();
|
||||||
$addreward->addReward($item_id, $item_num, $account_id);
|
$addreward->addReward($item_id, $item_num, $account_id);
|
||||||
@ -269,6 +270,7 @@ class ShopController{
|
|||||||
$shop_list = $this->randomShop();
|
$shop_list = $this->randomShop();
|
||||||
$user_db['shop_list'] = $shop_list;
|
$user_db['shop_list'] = $shop_list;
|
||||||
$r -> set($shop_uuid, json_encode($user_db));
|
$r -> set($shop_uuid, json_encode($user_db));
|
||||||
|
$r -> pexpire($shop_uuid, 1000 * 3600 * 24);
|
||||||
echo json_encode(array(
|
echo json_encode(array(
|
||||||
'errcode' => 0,
|
'errcode' => 0,
|
||||||
'errmsg'=> '',
|
'errmsg'=> '',
|
||||||
|
@ -128,7 +128,7 @@ class TeamController{
|
|||||||
'avatar_url' => $_REQUEST['avatar_url'],
|
'avatar_url' => $_REQUEST['avatar_url'],
|
||||||
));
|
));
|
||||||
$r->set(TEAMID_KEY . $team_uuid, json_encode($user_db));
|
$r->set(TEAMID_KEY . $team_uuid, json_encode($user_db));
|
||||||
|
$r -> pexpire(TEAMID_KEY . $team_uuid, 1000 * 600);
|
||||||
echo json_encode(array(
|
echo json_encode(array(
|
||||||
'errcode' => 0,
|
'errcode' => 0,
|
||||||
'errmsg' => '',
|
'errmsg' => '',
|
||||||
@ -179,6 +179,7 @@ class TeamController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$r->set(TEAMID_KEY . $team_uuid, json_encode($user_db));
|
$r->set(TEAMID_KEY . $team_uuid, json_encode($user_db));
|
||||||
|
$r -> pexpire(TEAMID_KEY . $team_uuid, 1000 * 600);
|
||||||
}
|
}
|
||||||
echo json_encode(array(
|
echo json_encode(array(
|
||||||
'errcode' => 0,
|
'errcode' => 0,
|
||||||
@ -221,6 +222,7 @@ class TeamController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$r->set(TEAMID_KEY . $team_uuid, json_encode($user_db));
|
$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) {
|
if (count($user_db['member_list']) == 0) {
|
||||||
$r->del(TEAMID_KEY . $team_uuid, json_encode($user_db));
|
$r->del(TEAMID_KEY . $team_uuid, json_encode($user_db));
|
||||||
}
|
}
|
||||||
@ -260,6 +262,7 @@ class TeamController{
|
|||||||
}
|
}
|
||||||
$user_db['auto_fill'] = $_REQUEST['auto_fill'];
|
$user_db['auto_fill'] = $_REQUEST['auto_fill'];
|
||||||
$r->set(TEAMID_KEY . $team_uuid, json_encode($user_db));
|
$r->set(TEAMID_KEY . $team_uuid, json_encode($user_db));
|
||||||
|
$r -> pexpire(TEAMID_KEY . $team_uuid, 1000 * 600);
|
||||||
}
|
}
|
||||||
echo json_encode(array(
|
echo json_encode(array(
|
||||||
'errcode' => 0,
|
'errcode' => 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user