fix: load CSV files from MinIO instead of local filesystem for rate search
All checks were successful
CI/CD Pipeline / Backend - Build, Test & Push (push) Successful in 7m30s
CI/CD Pipeline / Frontend - Build, Test & Push (push) Successful in 11m56s
CI/CD Pipeline / Integration Tests (push) Has been skipped
CI/CD Pipeline / Deployment Summary (push) Successful in 1s
CI/CD Pipeline / Deploy to Portainer (push) Successful in 11s
CI/CD Pipeline / Discord Notification (Failure) (push) Has been skipped
CI/CD Pipeline / Discord Notification (Success) (push) Successful in 1s
All checks were successful
CI/CD Pipeline / Backend - Build, Test & Push (push) Successful in 7m30s
CI/CD Pipeline / Frontend - Build, Test & Push (push) Successful in 11m56s
CI/CD Pipeline / Integration Tests (push) Has been skipped
CI/CD Pipeline / Deployment Summary (push) Successful in 1s
CI/CD Pipeline / Deploy to Portainer (push) Successful in 11s
CI/CD Pipeline / Discord Notification (Failure) (push) Has been skipped
CI/CD Pipeline / Discord Notification (Success) (push) Successful in 1s
Problem: - CSV files uploaded to MinIO via admin panel - But getAvailableCsvFiles() only listed local filesystem - Result: rate search returned 0 results even though files exist in MinIO Solution: - Modified getAvailableCsvFiles() to check MinIO first - Lists files from csv_rate_configs table with minioObjectKey - Falls back to local filesystem if MinIO not configured - Logs clearly which source is being used This ensures rate search uses the uploaded CSV files from MinIO storage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
010c804b2e
commit
84c31f38a0
@ -237,7 +237,26 @@ export class CsvRateLoaderAdapter implements CsvRateLoaderPort {
|
|||||||
|
|
||||||
async getAvailableCsvFiles(): Promise<string[]> {
|
async getAvailableCsvFiles(): Promise<string[]> {
|
||||||
try {
|
try {
|
||||||
// Ensure directory exists
|
// If MinIO/S3 is configured, list files from there
|
||||||
|
if (this.s3Storage && this.configService && this.csvConfigRepository) {
|
||||||
|
try {
|
||||||
|
const configs = await this.csvConfigRepository.findAll();
|
||||||
|
const minioFiles = configs
|
||||||
|
.filter(config => config.metadata?.minioObjectKey)
|
||||||
|
.map(config => config.metadata?.minioObjectKey as string);
|
||||||
|
|
||||||
|
if (minioFiles.length > 0) {
|
||||||
|
this.logger.log(`📂 Found ${minioFiles.length} CSV files in MinIO`);
|
||||||
|
return minioFiles;
|
||||||
|
} else {
|
||||||
|
this.logger.warn('⚠️ No CSV files configured in MinIO, falling back to local files');
|
||||||
|
}
|
||||||
|
} catch (minioError: any) {
|
||||||
|
this.logger.warn(`⚠️ Failed to list MinIO files: ${minioError.message}. Falling back to local files.`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback: list from local file system
|
||||||
try {
|
try {
|
||||||
await fs.access(this.csvDirectory);
|
await fs.access(this.csvDirectory);
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user