<commit_before>const Queue = require(`better-queue`)
const { store } = require(`../redux`)
const FastMemoryStore = require(`../query/better-queue-custom-store`)
const queryRunner = require(`../query/query-runner`)
const { websocketManager } = require(`../utils/websocket-manager`)
const GraphQLRunner = require(`./graphql-runner`).default

const createBaseOptions = () => {
  return {
    concurrent: Number(process.env.GATSBY_EXPERIMENTAL_QUERY_CONCURRENCY) || 4,
    // eslint-disable-next-line new-cap
    store: FastMemoryStore(),
    maxTimeout: 15000,
  }
}

const createBuildQueue = graphqlRunner => {
  if (!graphqlRunner) {
    graphqlRunner = new GraphQLRunner(store)
  }
  const handler = (queryJob, callback) =>
    queryRunner(graphqlRunner, queryJob)
      .then(result => callback(null, result))
      .catch(callback)
  const queue = new Queue(handler, createBaseOptions())
  return queue
}

const createDevelopQueue = getRunner => {
  const queueOptions = {
    ...createBaseOptions(),
    priority: (job, cb) => {<commit_msg>Revert "fix(gatsby): Set a timeout of 15 seconds on queries" (#23095)<commit_after>const Queue = require(`better-queue`)
const { store } = require(`../redux`)
const FastMemoryStore = require(`../query/better-queue-custom-store`)
const queryRunner = require(`../query/query-runner`)
const { websocketManager } = require(`../utils/websocket-manager`)
const GraphQLRunner = require(`./graphql-runner`).default

const createBaseOptions = () => {
  return {
    concurrent: Number(process.env.GATSBY_EXPERIMENTAL_QUERY_CONCURRENCY) || 4,
    // eslint-disable-next-line new-cap
    store: FastMemoryStore(),
  }
}

const createBuildQueue = graphqlRunner => {
  if (!graphqlRunner) {
    graphqlRunner = new GraphQLRunner(store)
  }
  const handler = (queryJob, callback) =>
    queryRunner(graphqlRunner, queryJob)
      .then(result => callback(null, result))
      .catch(callback)
  const queue = new Queue(handler, createBaseOptions())
  return queue
}

const createDevelopQueue = getRunner => {
  const queueOptions = {
    ...createBaseOptions(),
    priority: (job, cb) => {
{'fraction_non_alphanumeric': 0.14346389806512505, 'fraction_numerical': 0.0066068900424728644, 'mean_word_length': 4.208845208845209, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1989503', 'n_tokens_mistral': 673, 'n_tokens_neox': 645, 'n_words': 136}