<commit_before>Capistrano::Configuration.instance(:must_exist).load do
  namespace :thinking_sphinx do
  
    desc "Generate the Sphinx configuration file"
    task :configure, :roles => [:app, :worker] do
      rake "thinking_sphinx:configure"
    end
  
    desc "Index data"
    task :index, :roles => :worker do
      rake "thinking_sphinx:index"
    end
  
    desc "Start the Sphinx daemon"
    task :start, :roles => :worker do
      configure
      rake "thinking_sphinx:start"
    end
  
    desc "Stop the Sphinx daemon"
    task :stop, :roles => :worker do
      configure
      rake "thinking_sphinx:stop"
    end
  
    desc "Stop and then start the Sphinx daemon"
    task :restart, :roles => :worker do
      stop
      start
    end
  
    desc "Stop, re-index and then start the Sphinx daemon"
    task :rebuild, :roles => :worker  do
      stop
      index
      start
    end
  
    desc "Add the shared folder for sphinx files for the production environment"
    task :shared_sphinx_folder, :roles => [:app, :worker] do
      run "mkdir -p #{shared_path}/db/sphinx/production"
    end

    def rake(*tasks)
      rails_env = fetch(:rails_env, "production")
      rake = fetch(:rake, "rake")
      tasks.each do |t|
        run "if [ -d #{release_path} ]; then cd #{release_path}; else cd #{current_path}; fi; #{rake} RAILS_ENV=#{rails_env} #{t}"
      end
    end
  end
end
<commit_msg>Task should only run against servers defined with a worker role.<commit_after>Capistrano::Configuration.instance(:must_exist).load do
  namespace :thinking_sphinx do
  
    desc "Generate the Sphinx configuration file"
    task :configure, :roles => :worker do
      rake "thinking_sphinx:configure"
    end
  
    desc "Index data"
    task :index, :roles => :worker do
      rake "thinking_sphinx:index"
    end
  
    desc "Start the Sphinx daemon"
    task :start, :roles => :worker do
      configure
      rake "thinking_sphinx:start"
    end
  
    desc "Stop the Sphinx daemon"
    task :stop, :roles => :worker do
      configure
      rake "thinking_sphinx:stop"
    end
  
    desc "Stop and then start the Sphinx daemon"
    task :restart, :roles => :worker do
      stop
      start
    end
  
    desc "Stop, re-index and then start the Sphinx daemon"
    task :rebuild, :roles => :worker  do
      stop
      index
      start
    end
  
    desc "Add the shared folder for sphinx files for the production environment"
    task :shared_sphinx_folder, :roles => [:app, :worker] do
      run "mkdir -p #{shared_path}/db/sphinx/production"
    end

    def rake(*tasks)
      rails_env = fetch(:rails_env, "production")
      rake = fetch(:rake, "rake")
      tasks.each do |t|
        run "if [ -d #{release_path} ]; then cd #{release_path}; else cd #{current_path}; fi; #{rake} RAILS_ENV=#{rails_env} #{t}"
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.10122591943957969, 'fraction_numerical': 0.0, 'mean_word_length': 2.6289707750952984, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '4097609', 'n_tokens_mistral': 962, 'n_tokens_neox': 929, 'n_words': 299}