<commit_before>class ProjectObserver < BaseObserver
  def after_create(project)
    return true if project.forked?

    if project.import?
      RepositoryImportWorker.perform_in(5.seconds, project.id)
    else
      GitlabShellWorker.perform_async(
        :add_repository,
        project.path_with_namespace
      )

      log_info("#{project.owner.name} created a new project \"#{project.name_with_namespace}\"")
    end
  end

  def after_update(project)
    project.send_move_instructions if project.namespace_id_changed?
    project.rename_repo if project.path_changed?

    GitlabShellWorker.perform_async(
      :update_repository_head,<commit_msg>Update project last_activity_at on creation<commit_after>class ProjectObserver < BaseObserver
  def after_create(project)
    project.update_column(:last_activity_at, project.created_at)

    return true if project.forked?

    if project.import?
      RepositoryImportWorker.perform_in(5.seconds, project.id)
    else
      GitlabShellWorker.perform_async(
        :add_repository,
        project.path_with_namespace
      )

      log_info("#{project.owner.name} created a new project \"#{project.name_with_namespace}\"")
    end
  end

  def after_update(project)
    project.send_move_instructions if project.namespace_id_changed?
    project.rename_repo if project.path_changed?

    GitlabShellWorker.perform_async(
      :update_repository_head,
{'fraction_non_alphanumeric': 0.07659574468085106, 'fraction_numerical': 0.0014184397163120568, 'mean_word_length': 3.8993055555555554, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4870973', 'n_tokens_mistral': 418, 'n_tokens_neox': 408, 'n_words': 75}