mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-19 00:01:00 +08:00
fix admin exam-user detail error + improve announce check ReAnnounce log
This commit is contained in:
@@ -51,6 +51,7 @@ class ExamUser extends NexusModel
|
||||
}
|
||||
$currentValue = $progress[$index['index']] ?? 0;
|
||||
$requireValue = $index['require_value'];
|
||||
$unit = Exam::$indexes[$index['index']]['unit'] ?? '';
|
||||
switch ($index['index']) {
|
||||
case Exam::INDEX_UPLOADED:
|
||||
case Exam::INDEX_DOWNLOADED:
|
||||
@@ -58,7 +59,7 @@ class ExamUser extends NexusModel
|
||||
$requireValueAtomic = $requireValue * 1024 * 1024 * 1024;
|
||||
break;
|
||||
case Exam::INDEX_SEED_TIME_AVERAGE:
|
||||
$currentValueFormatted = number_format($currentValue / 3600, 2) . " {$index['unit']}";
|
||||
$currentValueFormatted = number_format($currentValue / 3600, 2) . " $unit";
|
||||
$requireValueAtomic = $requireValue * 3600;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -229,14 +229,16 @@ if ($compact == 1) {
|
||||
//check ReAnnounce
|
||||
$params = $_GET;
|
||||
unset($params['key']);
|
||||
$lockKey = md5(http_build_query($params));
|
||||
$reAnnounceQuery = http_build_query($params);
|
||||
$lockKey = md5($reAnnounceQuery);
|
||||
$log .= ", [CHECK_RE_ANNOUNCE], reAnnounceQuery: $reAnnounceQuery, lockKey: $lockKey";
|
||||
$redis = $Cache->getRedis();
|
||||
if (!$redis->set($lockKey, TIMENOW, ['nx', 'ex' => 5])) {
|
||||
do_log('ReAnnounce');
|
||||
do_log("$log, [YES_RE_ANNOUNCE]");
|
||||
benc_resp($rep_dict);
|
||||
exit();
|
||||
}
|
||||
|
||||
$log .= ", [NO_RE_ANNOUNCE]";
|
||||
unset($self);
|
||||
$res = sql_query($peerlistsql);
|
||||
if (isset($event) && $event == "stopped") {
|
||||
@@ -359,7 +361,7 @@ else // continue an existing session
|
||||
do_log("notSeedBoxMaxSpeedMbps: $notSeedBoxMaxSpeedMbps, upSpeedMbps: $upSpeedMbps");
|
||||
if ($upSpeedMbps > $notSeedBoxMaxSpeedMbps) {
|
||||
(new \App\Repositories\UserRepository())->updateDownloadPrivileges(null, $userid, 'no');
|
||||
do_log("user: $userid downloading privileges have been disabled! (over speed)", 'error');
|
||||
do_log("user: $userid downloading privileges have been disabled! (over speed), notSeedBoxMaxSpeedMbps: $notSeedBoxMaxSpeedMbps > upSpeedMbps: $upSpeedMbps", 'error');
|
||||
err("Your downloading privileges have been disabled! (over speed)");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user