const dotenv = require('dotenv');

dotenv.config();

const BASE_BACKOFF_MS = parseInt(process.env.BASE_BACKOFF_MS || '1000', 10); // backoff inicial para retry
const MAX_RETRIES = parseInt(process.env.MAX_RETRIES || '5', 10);
const REQUEST_DELAY_MS = parseInt(process.env.REQUEST_DELAY_MS || '250', 10);
 
function sleep(ms) {
   return new Promise(resolve => setTimeout(resolve, ms));
}

module.exports = { 
    BASE_BACKOFF_MS, 
    MAX_RETRIES, 
    REQUEST_DELAY_MS, 
    sleep 
};