refactor: rename hook form traffic.before_process to traffic.process.before

This commit is contained in:
xboard
2025-07-18 23:39:19 +08:00
parent 508caebdcd
commit 063a10f6bb
+3 -5
View File
@@ -119,11 +119,9 @@ class UserService
$server->rate = $server->getCurrentRate(); $server->rate = $server->getCurrentRate();
$server = $server->toArray(); $server = $server->toArray();
list($server, $protocol, $data) = HookManager::filter('traffic.before_process', [ list($server, $protocol, $data) = HookManager::filter('traffic.process.before', [$server, $protocol, $data]);
$server, // Compatible with legacy hook
$protocol, list($server, $protocol, $data) = HookManager::filter('traffic.before_process', [$server, $protocol, $data]);
$data
]);
$timestamp = strtotime(date('Y-m-d')); $timestamp = strtotime(date('Y-m-d'));
collect($data)->chunk(1000)->each(function ($chunk) use ($timestamp, $server, $protocol) { collect($data)->chunk(1000)->each(function ($chunk) use ($timestamp, $server, $protocol) {