/**
 * Pre-warms the cid-lookup in-memory directory cache (see
 * server/utils/telephony/cidDirectory.ts) once when the server boots, so the
 * very first inbound call after a deploy/PM2 reload doesn't pay the
 * cold-start iDempiere round-trip on server/api/telephony/cid-lookup.
 * Fire-and-forget: a failed/slow warm-up just leaves the route to do its own
 * (bounded, fail-open) cold-start fetch on the first real request.
 */
import { getCidDirectory } from '../utils/telephony/cidDirectory'

export default defineNitroPlugin(() => {
  getCidDirectory().catch((err: any) => {
    console.warn('[cid-lookup] startup pre-warm failed:', err?.message || err)
  })
})
