debian-mirror-gitlab/app/workers/project_cache_worker.rb

19 lines
357 B
Ruby
Raw Normal View History

2015-09-11 14:41:01 +05:30
class ProjectCacheWorker
include Sidekiq::Worker
sidekiq_options queue: :default
def perform(project_id)
project = Project.find(project_id)
2016-06-02 11:05:42 +05:30
return unless project.repository.exists?
2015-09-11 14:41:01 +05:30
project.update_repository_size
project.update_commit_count
if project.repository.root_ref
project.repository.build_cache
end
end
end