Skip to content

Commit

Permalink
Making endpoint random to balance between available ingress points
Browse files Browse the repository at this point in the history
  • Loading branch information
JustSteveKing committed Oct 25, 2023
1 parent 71267cc commit 18575fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Middlewares/TreblleMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Arr;
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
use Treblle\Exceptions\ConfigurationException;
use Treblle\Exceptions\TreblleApiException;
Expand Down Expand Up @@ -55,7 +56,7 @@ public function handle(Request $request, Closure $next, string $projectId = null
public function terminate(Request $request, JsonResponse|Response|SymfonyResponse $response): void
{
Treblle::log(
endpoint: Endpoint::PUNISHER,
endpoint: Arr::random(Endpoint::cases()),
data: $this->factory->make(
request: $request,
response: $response,
Expand Down

0 comments on commit 18575fd

Please sign in to comment.