mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-24 12:07:28 +08:00
feat: multiple improvements and bug fixes
- Add gift card redemption feature - Resolve custom range selection issue in overview - Allow log page size to be modified - Add subscription path change notification - Improve dynamic node rate feature - Support markdown documentation display for plugins - Reduce power reset service logging - Fix backend version number not updating after update
This commit is contained in:
@@ -60,14 +60,6 @@ class TrafficResetService
|
||||
]);
|
||||
|
||||
$this->clearUserCache($user);
|
||||
|
||||
Log::info(__('traffic_reset.reset_success'), [
|
||||
'user_id' => $user->id,
|
||||
'email' => $user->email,
|
||||
'old_traffic' => $oldTotal,
|
||||
'trigger_source' => $triggerSource,
|
||||
]);
|
||||
|
||||
return true;
|
||||
});
|
||||
} catch (\Exception $e) {
|
||||
@@ -283,11 +275,6 @@ class TrafficResetService
|
||||
$errors = [];
|
||||
$lastProcessedId = 0;
|
||||
|
||||
Log::info('Starting batch traffic reset task.', [
|
||||
'batch_size' => $batchSize,
|
||||
'start_time' => now()->toDateTimeString(),
|
||||
]);
|
||||
|
||||
try {
|
||||
do {
|
||||
$users = User::where('next_reset_at', '<=', time())
|
||||
@@ -307,9 +294,7 @@ class TrafficResetService
|
||||
break;
|
||||
}
|
||||
|
||||
$batchStartTime = microtime(true);
|
||||
$batchResetCount = 0;
|
||||
$batchErrors = [];
|
||||
|
||||
if ($progressCallback) {
|
||||
$progressCallback([
|
||||
@@ -319,13 +304,6 @@ class TrafficResetService
|
||||
]);
|
||||
}
|
||||
|
||||
Log::info("Processing batch #{$batchNumber}", [
|
||||
'batch_number' => $batchNumber,
|
||||
'batch_size' => $users->count(),
|
||||
'total_processed' => $totalProcessedCount,
|
||||
'id_range' => $users->first()->id . '-' . $users->last()->id,
|
||||
]);
|
||||
|
||||
foreach ($users as $user) {
|
||||
try {
|
||||
if ($this->checkAndReset($user, TrafficResetLog::SOURCE_CRON)) {
|
||||
@@ -352,17 +330,6 @@ class TrafficResetService
|
||||
}
|
||||
}
|
||||
|
||||
$batchDuration = round(microtime(true) - $batchStartTime, 2);
|
||||
|
||||
Log::info("Batch #{$batchNumber} processing complete", [
|
||||
'batch_number' => $batchNumber,
|
||||
'processed_count' => $users->count(),
|
||||
'reset_count' => $batchResetCount,
|
||||
'error_count' => count($batchErrors),
|
||||
'duration' => $batchDuration,
|
||||
'last_processed_id' => $lastProcessedId,
|
||||
]);
|
||||
|
||||
$batchNumber++;
|
||||
|
||||
if ($batchNumber % 10 === 0) {
|
||||
@@ -407,8 +374,6 @@ class TrafficResetService
|
||||
'completed_at' => now()->toDateTimeString(),
|
||||
];
|
||||
|
||||
Log::info('Batch traffic reset task completed', $result);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user