gitlab-org--gitlab-foss/app/workers/project_cache_worker.rb
Dmitriy Zaporozhets 67654a44d1
Avoid cache building for super-weird case when repository root_ref is nil
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-17 16:03:38 +02:00

15 lines
310 B
Ruby

class ProjectCacheWorker
include Sidekiq::Worker
sidekiq_options queue: :default
def perform(project_id)
project = Project.find(project_id)
project.update_repository_size
project.update_commit_count
if project.repository.root_ref
project.repository.build_cache
end
end
end