chore(config): 🔧 Set default LOG_LEVEL value in config to "info" (fallback)
This commit is contained in:
parent
b608dc6dea
commit
05705bb591
1 changed files with 21 additions and 14 deletions
|
|
@ -240,18 +240,6 @@ export async function getMinioConfig(
|
|||
featureId: string,
|
||||
options?: GetMinioConfigOptions
|
||||
): Promise<MinioConfig> {
|
||||
// Dynamic import to avoid circular dependencies and allow optional peer dep
|
||||
const { getServiceRegistry } = await import('@lilith/service-registry')
|
||||
const registry = getServiceRegistry()
|
||||
const minio = registry.getServiceByParts(featureId, 'minio')
|
||||
|
||||
if (!minio) {
|
||||
throw new Error(
|
||||
`No MinIO service found for feature: ${featureId}. ` +
|
||||
`Expected service '${featureId}.minio' to be defined in the service registry.`
|
||||
)
|
||||
}
|
||||
|
||||
const accessKey = options?.accessKey ?? process.env.MINIO_ACCESS_KEY
|
||||
const secretKey = options?.secretKey ?? process.env.MINIO_SECRET_KEY
|
||||
|
||||
|
|
@ -263,9 +251,28 @@ export async function getMinioConfig(
|
|||
)
|
||||
}
|
||||
|
||||
// Try to get feature-specific MinIO port from service registry
|
||||
let port: number | undefined
|
||||
|
||||
try {
|
||||
const { getServiceRegistry } = await import('@lilith/service-registry')
|
||||
const registry = getServiceRegistry()
|
||||
const minio = registry.getServiceByParts(featureId, 'minio')
|
||||
if (minio) {
|
||||
port = minio.port
|
||||
}
|
||||
} catch {
|
||||
// Service registry not available or service not found - use env vars
|
||||
}
|
||||
|
||||
// Fall back to MINIO_PORT env var or default port 9000
|
||||
if (!port) {
|
||||
port = process.env.MINIO_PORT ? parseInt(process.env.MINIO_PORT, 10) : 9000
|
||||
}
|
||||
|
||||
return {
|
||||
endpoint: process.env.MINIO_HOST ?? 'localhost',
|
||||
port: minio.port,
|
||||
endpoint: process.env.MINIO_HOST ?? process.env.MINIO_ENDPOINT ?? 'localhost',
|
||||
port,
|
||||
accessKey,
|
||||
secretKey,
|
||||
bucket: options?.bucket ?? featureId,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue