<commit_before>class DevelopersController < ApplicationController
  before_action :authenticate_developer!, only: [:edit, :search, :home, :show]
  before_action :check_search_params!, :cache_search_params, only: :search
  before_action :set_developer, only: [:edit, :show]
  after_action :enqueue_languages_worker, only: :show
  skip_before_action :ensure_signup_complete, only: :edit

  # GET /developers
  def index
  end

  # GET /developers/search
  def search
  end

  # GET /developers/:username
  def show
    FetchDeveloperWorker.perform_async(
      @login
    ) unless Rails.cache.exist?(@login)

    respond_to do |format|
      format.html
      format.json { head :ok }
    end
  end

  def home
    respond_to do |format|
      format.html
      format.json { head :ok }
    end
  end

  def edit
  end

  private

  def check_search_params!
    @search_params = FormatSearchParams.new(search_params)
    redirect_to root_path and return unless @search_params.valid?
  end

  def cache_search_params
    Rails.cache.fetch(@search_params.to_cache_key, expires: 2.days) do
      {
        query: @search_params.to_query,
        page: search_params['page'] || 1
      }
    end
  end

  def enqueue_languages_worker
    FetchDeveloperLanguagesWorker.perform_async(
      params[:id]
    ) unless Rails.cache.exist?([params[:id], 'languages'])
  end

  def search_params
    params.permit(
      :followers, :repos, :fullname, :location,
      :language, :hireable, :page
    )
  end

  def set_developer
    @login = params[:id]
    @developer = Developer.find_by_login(@login)
  end
end<commit_msg>Remove workers<commit_after>class DevelopersController < ApplicationController
  before_action :authenticate_developer!, only: [:edit, :search, :home, :show]
  before_action :check_search_params!, :cache_search_params, only: :search
  before_action :set_developer, only: [:edit, :show]
  skip_before_action :ensure_signup_complete, only: :edit

  # GET /developers
  def index
  end

  # GET /developers/search
  def search
  end

  # GET /developers/:username
  def show
    respond_to do |format|
      format.html
      format.json { head :ok }
    end
  end

  def home
    respond_to do |format|
      format.html
      format.json { head :ok }
    end
  end

  def edit
  end

  private

  def check_search_params!
    @search_params = FormatSearchParams.new(search_params)
    redirect_to root_path and return unless @search_params.valid?
  end

  def cache_search_params
    Rails.cache.fetch(@search_params.to_cache_key, expires: 2.days) do
      {
        query: @search_params.to_query,
        page: search_params['page'] || 1
      }
    end
  end

  def search_params
    params.permit(
      :followers, :repos, :fullname, :location,
      :language, :hireable, :page
    )
  end

  def set_developer
    @login = params[:id]
    @developer = Developer.find_by_login(@login)
  end
end
{'fraction_non_alphanumeric': 0.09175257731958762, 'fraction_numerical': 0.0013745704467353953, 'mean_word_length': 3.2558479532163744, 'pattern_counts': {'":': 0, '<': 5, '<?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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5550439', 'n_tokens_mistral': 987, 'n_tokens_neox': 934, 'n_words': 226}