<commit_before>class CloneWorker
  include Sidekiq::Worker

  def perform url, name, path, project_id
    project = Project.find project_id
    
    begin
      Git.clone(url, name, path: path)
    rescue => e
      Rails.logger.error e.message
      invalidate project
    end
  end
  
  def invalidate project
    project.can_be_cloned = false
    project.save(validate: false)
  end
end
<commit_msg>CloneWorker: adicionando opção ‘depth: 1’ ao clonar um repositório. vamos economizar tempo e banda \o/<commit_after>class CloneWorker
  include Sidekiq::Worker

  def perform url, name, path, project_id
    project = Project.find project_id
    
    begin
      Git.clone(url, name, path: path, depth: 1)
    rescue => e
      Rails.logger.error e.message
      invalidate project
    end
  end
  
  def invalidate project
    project.can_be_cloned = false
    project.save(validate: false)
  end
end

{'fraction_non_alphanumeric': 0.06976744186046512, 'fraction_numerical': 0.0022148394241417496, 'mean_word_length': 2.896551724137931, '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': '5972573', 'n_tokens_mistral': 292, 'n_tokens_neox': 289, 'n_words': 86}