import { shouldAutoStartScheduler } from '../utils/db'
import { startServerScheduler } from '../utils/server-scheduler'

export default defineNitroPlugin(() => {
  // 스케줄러 자동 시작 (환경에 따라)
  if (shouldAutoStartScheduler()) {
    startServerScheduler()
    console.log('[Server] Plugin initialized - scheduler auto-started (production mode)')
  } else {
    console.log('[Server] Plugin initialized - scheduler NOT started (development mode - use API to start)')
  }
})
