diff --git a/backend-node/src/app.ts b/backend-node/src/app.ts index 2e753b56..87470dd6 100644 --- a/backend-node/src/app.ts +++ b/backend-node/src/app.ts @@ -282,7 +282,7 @@ app.listen(PORT, HOST, async () => { // 배치 스케줄러 초기화 try { - await BatchSchedulerService.initialize(); + await BatchSchedulerService.initializeScheduler(); logger.info(`⏰ 배치 스케줄러가 시작되었습니다.`); } catch (error) { logger.error(`❌ 배치 스케줄러 초기화 실패:`, error); diff --git a/backend-node/src/controllers/batchManagementController.ts b/backend-node/src/controllers/batchManagementController.ts index 61194485..cc91de80 100644 --- a/backend-node/src/controllers/batchManagementController.ts +++ b/backend-node/src/controllers/batchManagementController.ts @@ -594,7 +594,7 @@ export class BatchManagementController { if (result.success && result.data) { // 스케줄러에 자동 등록 ✅ try { - await BatchSchedulerService.scheduleBatchConfig(result.data); + await BatchSchedulerService.scheduleBatch(result.data); console.log( `✅ 새로운 배치가 스케줄러에 등록되었습니다: ${batchName} (ID: ${result.data.id})` ); diff --git a/backend-node/src/services/batchSchedulerService.ts b/backend-node/src/services/batchSchedulerService.ts index a8f755c3..780118fb 100644 --- a/backend-node/src/services/batchSchedulerService.ts +++ b/backend-node/src/services/batchSchedulerService.ts @@ -124,6 +124,14 @@ export class BatchSchedulerService { try { logger.info(`배치 실행 시작: ${config.batch_name} (ID: ${config.id})`); + // 매핑 정보가 없으면 상세 조회로 다시 가져오기 + if (!config.batch_mappings || config.batch_mappings.length === 0) { + const fullConfig = await BatchService.getBatchConfigById(config.id); + if (fullConfig.success && fullConfig.data) { + config = fullConfig.data; + } + } + // 실행 로그 생성 const executionLogResponse = await BatchExecutionLogService.createExecutionLog({