revert peer count

This commit is contained in:
xiaomlove
2022-04-22 01:32:17 +08:00
parent 686ec2754c
commit b9190d9f6e
7 changed files with 18 additions and 30 deletions

View File

@@ -2563,12 +2563,12 @@ else {
//// check every 60 seconds //////////////////
$activeseed = $Cache->get_value('user_'.$CURUSER["id"].'_active_seed_count');
if ($activeseed == ""){
$activeseed = count_peer(sprintf("userid = %s and seeder = 'yes'", $CURUSER['id']), 'torrent');
$activeseed = get_row_count("peers","WHERE userid=" . sqlesc($CURUSER["id"]) . " AND seeder='yes'");
$Cache->cache_value('user_'.$CURUSER["id"].'_active_seed_count', $activeseed, 60);
}
$activeleech = $Cache->get_value('user_'.$CURUSER["id"].'_active_leech_count');
if ($activeleech == ""){
$activeleech = count_peer(sprintf("userid = %s and seeder = 'no'", $CURUSER['id']), 'torrent');
$activeleech = get_row_count("peers","WHERE userid=" . sqlesc($CURUSER["id"]) . " AND seeder='no'");
$Cache->cache_value('user_'.$CURUSER["id"].'_active_leech_count', $activeleech, 60);
}
$unread = $Cache->get_value('user_'.$CURUSER["id"].'_unread_message_count');