Class: ProjectCacheWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Worker
Defined in:
app/workers/project_cache_worker.rb

Instance Method Summary collapse

Instance Method Details

#perform(project_id) ⇒ Object


6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/workers/project_cache_worker.rb', line 6

def perform(project_id)
  project = Project.find(project_id)

  return unless project.repository.exists?

  project.update_repository_size
  project.update_commit_count

  if project.repository.root_ref
    project.repository.build_cache
  end
end