From 6e25ab8da8a90a6d9bf40ccc83e36f119fb27568 Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Tue, 1 Jul 2025 10:44:02 +0000 Subject: (김준회) 비활성화한 node-cron 진입점 (instrumentation.ts) 추가 및 NONSAP 동기화 개발건 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- instrumentation.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 instrumentation.ts (limited to 'instrumentation.ts') diff --git a/instrumentation.ts b/instrumentation.ts new file mode 100644 index 00000000..48d013dd --- /dev/null +++ b/instrumentation.ts @@ -0,0 +1,19 @@ +/** + * instrumentation 진입점 - 여러 JOB들이 등록될 수 있으므로 확장성을 위해 최소한의 메서드 호출만으로 유지 + */ +export async function register() { + console.log('Application instrumentation registered'); + + // Node.js runtime에서만 동기화 스케줄러 시작 + if (process.env.NEXT_RUNTIME === 'nodejs') { + try { + // 동적 import로 Edge Runtime 호환성 확보 - 개선된 서비스 사용 + // PLM 동기화 스케줄러인데, 1회만 가져오기로 했으므로 주석 처리 + // const { startEnhancedSyncScheduler } = await import('./lib/nonsap-sync/enhanced-sync-service'); + // startEnhancedSyncScheduler(); + } catch (error) { + console.error('Failed to start Enhanced NONSAP sync scheduler:', error); + // 스케줄러 실패해도 애플리케이션은 계속 실행 + } + } +} -- cgit v1.2.3