mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 10:37:30 -07:00
parent
64df3c5538
commit
21c8e7d48a
58 changed files with 226 additions and 228 deletions
|
@ -64,6 +64,6 @@ if ($poll_max_days = (int)$bb_cfg['poll_max_days']) {
|
|||
DB()->query("UPDATE " . BB_USERS . " SET user_newpasswd = '' WHERE user_lastvisit < " . (TIMENOW - 7 * 86400));
|
||||
|
||||
// Чистка кеша постов
|
||||
if ($posts_days = intval($bb_cfg['posts_cache_days_keep'])) {
|
||||
if ($posts_days = (int)$bb_cfg['posts_cache_days_keep']) {
|
||||
DB()->query("DELETE FROM " . BB_POSTS_HTML . " WHERE post_html_time < DATE_SUB(NOW(), INTERVAL $posts_days DAY)");
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ DB()->query("
|
|||
");
|
||||
|
||||
// Tor-Stats cleanup
|
||||
if ($torstat_days_keep = intval($bb_cfg['torstat_days_keep'])) {
|
||||
if ($torstat_days_keep = (int)$bb_cfg['torstat_days_keep']) {
|
||||
DB()->query("DELETE QUICK FROM " . BB_BT_TORSTAT . " WHERE last_modified_torstat < DATE_SUB(NOW(), INTERVAL $torstat_days_keep DAY)");
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ while (true) {
|
|||
|
||||
$prune_users = $not_activated_users = $not_active_users = array();
|
||||
|
||||
if ($not_activated_days = intval($bb_cfg['user_not_activated_days_keep'])) {
|
||||
if ($not_activated_days = (int)$bb_cfg['user_not_activated_days_keep']) {
|
||||
$sql = DB()->fetch_rowset("SELECT user_id FROM " . BB_USERS . "
|
||||
WHERE user_level = 0
|
||||
AND user_lastvisit = 0
|
||||
|
@ -50,7 +50,7 @@ while (true) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($not_active_days = intval($bb_cfg['user_not_active_days_keep'])) {
|
||||
if ($not_active_days = (int)$bb_cfg['user_not_active_days_keep']) {
|
||||
$sql = DB()->fetch_rowset("SELECT user_id FROM " . BB_USERS . "
|
||||
WHERE user_level = 0
|
||||
AND user_posts = 0
|
||||
|
|
|
@ -27,10 +27,10 @@ if (!defined('BB_ROOT')) {
|
|||
die(basename(__FILE__));
|
||||
}
|
||||
|
||||
$user_session_expire_time = TIMENOW - intval($bb_cfg['user_session_duration']);
|
||||
$admin_session_expire_time = TIMENOW - intval($bb_cfg['admin_session_duration']);
|
||||
$user_session_expire_time = TIMENOW - (int)$bb_cfg['user_session_duration'];
|
||||
$admin_session_expire_time = TIMENOW - (int)$bb_cfg['admin_session_duration'];
|
||||
|
||||
$user_session_gc_time = $user_session_expire_time - intval($bb_cfg['user_session_gc_ttl']);
|
||||
$user_session_gc_time = $user_session_expire_time - (int)$bb_cfg['user_session_gc_ttl'];
|
||||
$admin_session_gc_time = $admin_session_expire_time;
|
||||
|
||||
// ############################ Tables LOCKED ################################
|
||||
|
|
|
@ -81,8 +81,8 @@ DB()->query("
|
|||
|
||||
// Clean peers table
|
||||
if ($tr_cfg['autoclean']) {
|
||||
$announce_interval = max(intval($bb_cfg['announce_interval']), 60);
|
||||
$expire_factor = max(floatval($tr_cfg['expire_factor']), 1);
|
||||
$announce_interval = max((int)$bb_cfg['announce_interval'], 60);
|
||||
$expire_factor = max((float)$tr_cfg['expire_factor'], 1);
|
||||
$peer_expire_time = TIMENOW - floor($announce_interval * $expire_factor);
|
||||
|
||||
DB()->query("DELETE FROM " . BB_BT_TRACKER . " WHERE update_time < $peer_expire_time");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue