<commit_before>$:.unshift(File.expand_path('..', File.dirname(__FILE__)))

require 'bundler/setup'
require 'gh'
require 'roadie'
require 'ostruct'
require 'metriks/librato_metrics_reporter'
require 'travis/tasks/error_handler'
require 'travis/support'
require 'travis/tasks/config'
require 'travis/task'
require 'travis/addons'
require 'travis/tasks/middleware/metriks'
require 'travis/tasks/middleware/logging'

$stdout.sync = true

if Travis.config.sentry.dsn
  require 'raven'
  Raven.configure do |config|
    config.dsn = Travis.config.sentry.dsn

    config.current_environment = Travis.env
    config.environments = ["staging", "production"]
  end
end

Sidekiq.configure_server do |config|
  config.redis = {
    :url       => Travis.config.redis.url,
    :namespace => Travis.config.sidekiq.namespace
  }
  config.server_middleware do |chain|
    chain.add Travis::Tasks::Middleware::Metriks
    chain.add Travis::Tasks::Middleware::Logging

    if defined?(::Raven::Sidekiq)
      chain.remove(::Raven::Sidekiq)
    end

    chain.remove(Sidekiq::Middleware::Server::Logging)
    chain.add(Travis::Tasks::ErrorHandler)
  end
end

class Travis::Async::Sidekiq::Worker
  sidekiq_options retry: Travis.config.sidekiq.retry
end<commit_msg>Prevent sidekiq jobs from going to DJQ<commit_after>$:.unshift(File.expand_path('..', File.dirname(__FILE__)))

require 'bundler/setup'
require 'gh'
require 'roadie'
require 'ostruct'
require 'metriks/librato_metrics_reporter'
require 'travis/tasks/error_handler'
require 'travis/support'
require 'travis/tasks/config'
require 'travis/task'
require 'travis/addons'
require 'travis/tasks/middleware/metriks'
require 'travis/tasks/middleware/logging'

$stdout.sync = true

if Travis.config.sentry.dsn
  require 'raven'
  Raven.configure do |config|
    config.dsn = Travis.config.sentry.dsn

    config.current_environment = Travis.env
    config.environments = ["staging", "production"]
  end
end

Sidekiq.configure_server do |config|
  config.redis = {
    :url       => Travis.config.redis.url,
    :namespace => Travis.config.sidekiq.namespace
  }
  config.server_middleware do |chain|
    chain.add Travis::Tasks::Middleware::Metriks
    chain.add Travis::Tasks::Middleware::Logging

    if defined?(::Raven::Sidekiq)
      chain.remove(::Raven::Sidekiq)
    end

    chain.remove(Sidekiq::Middleware::Server::Logging)
    chain.add(Travis::Tasks::ErrorHandler)
  end
end

class Travis::Async::Sidekiq::Worker
  sidekiq_options retry: Travis.config.sidekiq.retry, dead: false
end
{'fraction_non_alphanumeric': 0.12984956452889945, 'fraction_numerical': 0.0, 'mean_word_length': 4.89044289044289, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6301345', 'n_tokens_mistral': 875, 'n_tokens_neox': 876, 'n_words': 153}