Skip to content

Commit

Permalink
fix: #273 fix metrics validation 2
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdan-shulha committed Nov 22, 2024
1 parent 16f3afb commit 0da92de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api-nodes/Http/Controllers/MetricsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ public function __invoke(Request $request, Logger $log, Node $node)

$ruleIds = $processes->mapWithKeys(function (Process $process) {
$caddyIds = collect($process->caddy)->pluck('id');
$redirectRuleIds = collect($process)
->flatMap(fn (Process $process) => collect($process->caddy)->flatMap(fn (Caddy $caddy) => collect($caddy->redirectRules)->pluck('id')))
$redirectRuleIds = collect($process->caddy)
->flatMap(fn (Caddy $caddy) => collect($caddy->redirectRules)->pluck('id'))
->unique()
->toArray();
$rewriteRuleIds = collect($process)
->flatMap(fn (Process $process) => collect($process->caddy)->flatMap(fn (Caddy $caddy) => collect($caddy->rewriteRules)->pluck('id')))
$rewriteRuleIds = collect($process->caddy)
->flatMap(fn (Caddy $caddy) => collect($caddy->rewriteRules)->pluck('id'))
->unique()
->toArray();

Expand Down

0 comments on commit 0da92de

Please sign in to comment.