Enable Discovery debug logging for production troubleshooting

- Add DISCOVERY_LOG_LEVEL=debug
- Add DISCOVERY_SHOW_PROGRESS=true
- Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
2025-08-11 20:13:26 +02:00
parent 59fd3dd3b1
commit 55a330b223
3683 changed files with 2956207 additions and 16948 deletions

View File

@@ -1,29 +1,42 @@
<?php
declare(strict_types=1);
namespace App\Framework\Queue;
use App\Framework\Core\PathProvider;
use App\Framework\DI\Initializer;
use App\Framework\Logging\Logger;
use App\Framework\Redis\RedisConfig;
use App\Framework\Redis\RedisConnection;
final readonly class QueueInitializer
{
public function __construct(
private PathProvider $pathProvider
)
{
) {
}
#[Initializer]
public function __invoke(): Queue
public function __invoke(Logger $logger): Queue
{
$queue = new RedisQueue(
queueName: 'commands',
host: 'redis',
port: 6379,
try {
$redisConfig = new RedisConfig(
host: 'redis',
port: 6379,
database: 2 // Use DB 2 for queue
);
$redisConnection = new RedisConnection($redisConfig, 'queue');
);
return new RedisQueue($redisConnection, 'commands');
} catch (\Throwable $e) {
// Fallback to file queue if Redis is not available
$logger->warning("⚠️ Redis queue not available, falling back to file queue", [
'error' => $e->getMessage(),
]);
$path = $this->pathProvider->resolvePath('/src/Framework/CommandBus/storage/queue/');
$path = $this->pathProvider->resolvePath('/src/Framework/CommandBus/storage/queue/');
return new FileQueue($path);
return new FileQueue($path, logger: $logger);
}
}
}