<commit_before>const config = {
  development: {
    debug: true,
    client: 'postgresql',
    connection: {
      user: 'argos',
      database: 'development',
    },
    pool: {
      min: 2,
      max: 10,
    },
    seeds: {
      directory: './seeds',
    },
  },
  test: {
    client: 'postgresql',
    connection: {
      user: 'argos',
      database: 'test',
    },
    pool: {
      min: 2,
      max: 10,
    },
  },
  production: {
    client: 'postgresql',
    pool: {
      min: 2,
      max: 10,
    },
  },
}

if (process.env.DATABASE_URL) {
  const url = require('url')
  const pgProd = url.parse(process.env.DATABASE_URL)

  config.production.connection = {
    host: pgProd.hostname,
    port: pgProd.port,
    user: pgProd.auth.split(':')[0],<commit_msg>Fix max connections reached (#133)<commit_after>const workers = 3
const maxConnectionsAllowed = 20
const freeConnectionsForThierdTools = 2

const config = {
  development: {
    debug: true,
    client: 'postgresql',
    connection: {
      user: 'argos',
      database: 'development',
    },
    pool: {
      min: 2,
      max: 10,
    },
    seeds: {
      directory: './seeds',
    },
  },
  test: {
    client: 'postgresql',
    connection: {
      user: 'argos',
      database: 'test',
    },
    pool: {
      min: 2,
      max: 10,
    },
  },
  production: {
    client: 'postgresql',
    pool: {
      min: 2,
      max: Math.floor((maxConnectionsAllowed - freeConnectionsForThierdTools) / workers),
    },
  },
}

if (process.env.DATABASE_URL) {
  const url = require('url')
  const pgProd = url.parse(process.env.DATABASE_URL)

  config.production.connection = {
    host: pgProd.hostname,
    port: pgProd.port,
    user: pgProd.auth.split(':')[0],
{'fraction_non_alphanumeric': 0.15362485615650173, 'fraction_numerical': 0.014384349827387802, 'mean_word_length': 2.2383612662942274, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4456859', 'n_tokens_mistral': 647, 'n_tokens_neox': 624, 'n_words': 126}