2015-07-17 08:50:03 -04:00
|
|
|
class ProjectCacheWorker
|
|
|
|
include Sidekiq::Worker
|
|
|
|
|
|
|
|
sidekiq_options queue: :default
|
|
|
|
|
|
|
|
def perform(project_id)
|
2015-07-17 09:22:56 -04:00
|
|
|
project = Project.find(project_id)
|
2016-03-27 09:17:49 -04:00
|
|
|
|
|
|
|
return unless project.repository.exists?
|
|
|
|
|
2015-07-17 09:22:56 -04:00
|
|
|
project.update_repository_size
|
|
|
|
project.update_commit_count
|
2015-07-17 10:03:38 -04:00
|
|
|
|
|
|
|
if project.repository.root_ref
|
|
|
|
project.repository.build_cache
|
|
|
|
end
|
2015-07-17 08:50:03 -04:00
|
|
|
end
|
|
|
|
end
|