From a083eba9d5df5ea370760f9938eb8d251fe89456 Mon Sep 17 00:00:00 2001 From: xiaomlove <1939737565@qq.com> Date: Tue, 10 Dec 2024 01:26:16 +0800 Subject: [PATCH] reset seed_points_per_hour --- include/cleanup.php | 5 ++++- include/constants.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/cleanup.php b/include/cleanup.php index de341f2b..12ba75ca 100644 --- a/include/cleanup.php +++ b/include/cleanup.php @@ -249,7 +249,8 @@ function docleanup($forceAll = 0, $printProgress = false) { set_time_limit(0); ignore_user_abort(1); $now = time(); - $nowStr = \Carbon\Carbon::now()->toDateTimeString(); + $carbonNow = \Carbon\Carbon::now(); + $nowStr = $carbonNow->toDateTimeString(); do_log("start docleanup(), forceAll: $forceAll, printProgress: $printProgress, now: $now, " . date('Y-m-d H:i:s', $now)); //Priority Class 1: cleanup every 15 mins @@ -257,6 +258,8 @@ function docleanup($forceAll = 0, $printProgress = false) { $deadtime = deadtime(); $deadtime = date("Y-m-d H:i:s",$deadtime); sql_query("DELETE FROM peers WHERE last_action < ".sqlesc($deadtime)) or sqlerr(__FILE__, __LINE__); + //rest seed_points_per_hour + sql_query("update users set seed_points_per_hour = 0 where seed_points_updated_at < " . sqlesc($deadtime)); $log = 'update peer status'; do_log($log); if ($printProgress) { diff --git a/include/constants.php b/include/constants.php index 81d9f909..fb01740f 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@