Skip to content

Commit

Permalink
reset seed_points_per_hour
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomlove committed Dec 9, 2024
1 parent 035fd36 commit a083eba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion include/cleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,17 @@ 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
//2.update peer status
$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) {
Expand Down
2 changes: 1 addition & 1 deletion include/constants.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.15');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-11-27');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-12-10');
defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
Expand Down

0 comments on commit a083eba

Please sign in to comment.