summaryrefslogtreecommitdiff
path: root/instrumentation.ts
blob: 48d013dd70e37d5cbd1a382ce71da51f65b0902e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);
      // 스케줄러 실패해도 애플리케이션은 계속 실행
    }
  }
}