Make caching for ban list (#1269)

This commit is contained in:
Roman Kelesidis 2023-12-27 00:16:54 +07:00 committed by GitHub
commit 66083cabad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 46 additions and 31 deletions

View file

@ -0,0 +1,21 @@
<?php
/**
* TorrentPier Bull-powered BitTorrent tracker engine
*
* @copyright Copyright (c) 2005-2024 TorrentPier (https://torrentpier.com)
* @link https://github.com/torrentpier/torrentpier for the canonical source repository
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
*/
if (!defined('BB_ROOT')) {
die(basename(__FILE__));
}
$sql = "SELECT * FROM " . BB_BANLIST;
$bans = [];
foreach (DB()->fetch_rowset($sql) as $row) {
$bans[$row['ban_userid']] = $row;
}
$this->store('ban_list', $bans);

View file

@ -11,9 +11,8 @@ if (!defined('BB_ROOT')) {
die(basename(__FILE__));
}
$ranks = [];
$sql = "SELECT * FROM " . BB_RANKS;
$ranks = [];
foreach (DB()->fetch_rowset($sql) as $row) {
$ranks[$row['rank_id']] = $row;