Keep similar-ai from tripping the global circuit on a lone URL 502, clamp Qdrant search to 100, and add Server-Timing plus slow-request logging. Studio shared props, Academy S3 exists caching, heat chunking, and Redis/scheduler hygiene stay in this rollout.
34 lines
769 B
PHP
34 lines
769 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Support\Queues;
|
|
|
|
final class QueuedJobClassMatcher
|
|
{
|
|
public static function className(string $rawPayload): ?string
|
|
{
|
|
$decoded = json_decode($rawPayload, true);
|
|
if (! is_array($decoded)) {
|
|
return null;
|
|
}
|
|
|
|
$display = $decoded['displayName'] ?? null;
|
|
if (is_string($display) && $display !== '') {
|
|
return $display;
|
|
}
|
|
|
|
$command = $decoded['data']['commandName'] ?? null;
|
|
if (is_string($command) && $command !== '') {
|
|
return $command;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
public static function isClass(string $rawPayload, string $class): bool
|
|
{
|
|
return self::className($rawPayload) === $class;
|
|
}
|
|
}
|