BigW Consortium Gitlab

project_cache_worker.rb 357 Bytes
Newer Older
1 2 3 4 5 6
class ProjectCacheWorker
  include Sidekiq::Worker

  sidekiq_options queue: :default

  def perform(project_id)
7
    project = Project.find(project_id)
8 9 10

    return unless project.repository.exists?

11 12
    project.update_repository_size
    project.update_commit_count
13 14 15 16

    if project.repository.root_ref
      project.repository.build_cache
    end
17 18
  end
end