<commit_before>import url from 'url'
import express from 'express'
import toureiro from 'toureiro'

import config from 'src/config'
import {userCan} from 'src/common/util'

const app = new express.Router()
const redisConfig = url.parse(config.server.redis.url)
const redisPasswordOpts = redisConfig.auth ? {password: redisConfig.auth.split(':')[1]} : {}
const toureiroApp = toureiro({
  redis: {
    host: redisConfig.hostname,
    port: redisConfig.port,
    ...redisPasswordOpts,
  },
})

app.use(
  '/job-queues',
  (req, res, next) => {
    if (!req.user || !userCan(req.user, 'monitorJobQueues')) {
      throw new Error('You are not authorized to do that.')
    }
    next()<commit_msg>hotfix: fix redis connection in prod<commit_after>import url from 'url'
import express from 'express'
import toureiro from 'toureiro'

import config from 'src/config'
import {userCan} from 'src/common/util'

const app = new express.Router()
const redisConfig = url.parse(config.server.redis.url)
const redisPasswordOpts = redisConfig.auth ? {auth_pass: redisConfig.auth.split(':')[1]} : {} // eslint-disable-line camelcase
const toureiroApp = toureiro({
  redis: {
    host: redisConfig.hostname,
    port: redisConfig.port,
    ...redisPasswordOpts,
  },
})

app.use(
  '/job-queues',
  (req, res, next) => {
    if (!req.user || !userCan(req.user, 'monitorJobQueues')) {
      throw new Error('You are not authorized to do that.')
    }
    next()
{'fraction_non_alphanumeric': 0.1450381679389313, 'fraction_numerical': 0.0013879250520471894, 'mean_word_length': 4.024390243902439, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2719797', 'n_tokens_mistral': 495, 'n_tokens_neox': 499, 'n_words': 126}