import os from 'os';

const envVal = Number.parseInt(process.env.IMPORT_CONCURRENCY ?? '', 10);
export const IMPORT_CONCURRENCY =
  Number.isFinite(envVal) && envVal > 0 ? envVal : Math.min(8, Math.max(1, os.cpus().length - 1));

export default IMPORT_CONCURRENCY;
