fix: DockerSecretsResolver - don't normalize absolute paths like /var/www/html/...
Some checks failed
Deploy Application / deploy (push) Has been cancelled
Some checks failed
Deploy Application / deploy (push) Has been cancelled
This commit is contained in:
@@ -5,28 +5,44 @@ declare(strict_types=1);
|
||||
namespace App\Framework\CommandBus\Middleware;
|
||||
|
||||
use App\Framework\CommandBus\Middleware;
|
||||
use App\Framework\DI\Container;
|
||||
use App\Framework\Performance\Contracts\PerformanceCollectorInterface;
|
||||
use App\Framework\Performance\PerformanceCategory;
|
||||
|
||||
final readonly class PerformanceMonitoringMiddleware implements Middleware
|
||||
{
|
||||
public function __construct(
|
||||
private PerformanceCollectorInterface $collector
|
||||
private Container $container
|
||||
) {
|
||||
}
|
||||
|
||||
public function handle(object $command, callable $next): mixed
|
||||
{
|
||||
// Performance Monitoring ist optional - nur ausführen wenn Collector verfügbar
|
||||
if (!$this->container->has(PerformanceCollectorInterface::class)) {
|
||||
return $next($command);
|
||||
}
|
||||
|
||||
$collector = $this->container->get(PerformanceCollectorInterface::class);
|
||||
|
||||
// Prüfe ob Performance Tracking aktiviert ist
|
||||
if (!$collector->isEnabled()) {
|
||||
return $next($command);
|
||||
}
|
||||
|
||||
$commandKey = 'command_' . basename(str_replace('\\', '/', $command::class));
|
||||
|
||||
$this->collector->startTiming($commandKey, PerformanceCategory::SYSTEM, [
|
||||
$collector->startTiming($commandKey, PerformanceCategory::SYSTEM, [
|
||||
'command_class' => $command::class,
|
||||
]);
|
||||
|
||||
$result = $next($command);
|
||||
|
||||
$this->collector->endTiming($commandKey);
|
||||
|
||||
return $result;
|
||||
try {
|
||||
$result = $next($command);
|
||||
$collector->endTiming($commandKey);
|
||||
return $result;
|
||||
} catch (\Throwable $e) {
|
||||
$collector->endTiming($commandKey);
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user