<commit_before>class SearchController < ApplicationController
  before_action :authenticate_user!
  before_action :prepare_search_params!, :cache_query_metadata,
                :enqueue_search_worker

  protected

  def cache_query_metadata
    Rails.cache.write(search_cache_key, query_metadata)
  end

  def prepare_search_params!
    @prepared_params = PrepareSearchParams.new(search_params, current_user)
  end

  def enqueue_search_worker
    Rails.cache.fetch([@prepared_params.to_query, 'worker']) do
      SearchDevelopersJob.enqueue(search_cache_key)
    end<commit_msg>Convert params to hex digest<commit_after>class SearchController < ApplicationController
  before_action :authenticate_user!
  before_action :prepare_search_params!, :cache_query_metadata,
                :enqueue_search_worker

  protected

  def cache_query_metadata
    Rails.cache.write(search_cache_key, query_metadata)
  end

  def prepare_search_params!
    @prepared_params = PrepareSearchParams.new(search_params, current_user)
  end

  def enqueue_search_worker
    hex_string = Digest::SHA256.hexdigest(@prepared_params.to_props.to_s)
    Rails.cache.fetch([hex_string, 'worker']) do
      SearchDevelopersJob.enqueue(search_cache_key)
    end
{'fraction_non_alphanumeric': 0.06726094003241491, 'fraction_numerical': 0.0024311183144246355, 'mean_word_length': 5.1138613861386135, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4536675', 'n_tokens_mistral': 392, 'n_tokens_neox': 366, 'n_words': 61}