debian-mirror-gitlab/app/workers/expire_build_artifacts_worker.rb
2016-06-16 23:09:34 +05:30

13 lines
341 B
Ruby

class ExpireBuildArtifactsWorker
include Sidekiq::Worker
def perform
Rails.logger.info 'Cleaning old build artifacts'
builds = Ci::Build.with_expired_artifacts
builds.find_each(batch_size: 50).each do |build|
Rails.logger.debug "Removing artifacts build #{build.id}..."
build.erase_artifacts!
end
end
end