Cleanup old packages from testing sub repository
This commit is contained in:
parent
2899728a33
commit
e30920d185
|
@ -427,12 +427,12 @@ class BuildList < ActiveRecord::Base
|
|||
new_core? ? abf_worker_log : I18n.t('layout.build_lists.log.not_available')
|
||||
end
|
||||
|
||||
def last_published
|
||||
def last_published(testing = false)
|
||||
BuildList.where(:project_id => self.project_id,
|
||||
:save_to_repository_id => self.save_to_repository_id)
|
||||
.for_platform(self.build_for_platform_id)
|
||||
.scoped_to_arch(self.arch_id)
|
||||
.for_status(BUILD_PUBLISHED)
|
||||
.for_status(testing ? BUILD_PUBLISHED_INTO_TESTING : BUILD_PUBLISHED)
|
||||
.recent
|
||||
end
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ module AbfWorker
|
|||
|
||||
old_packages = packages_structure
|
||||
build_lists_for_cleanup.each do |bl|
|
||||
bl.last_published.includes(:packages).limit(2).each{ |old_bl|
|
||||
bl.last_published(testing).includes(:packages).limit(2).each{ |old_bl|
|
||||
fill_packages(old_bl, old_packages, :fullname)
|
||||
}
|
||||
end
|
||||
|
@ -309,7 +309,7 @@ module AbfWorker
|
|||
# remove duplicates of sources for different arches
|
||||
bl.packages.by_package_type('source').each{ |s| new_sources["#{s.fullname}"] = s.sha1 }
|
||||
self.class.fill_packages(bl, packages)
|
||||
bl.last_published.includes(:packages).limit(2).each{ |old_bl|
|
||||
bl.last_published(testing).includes(:packages).limit(2).each{ |old_bl|
|
||||
self.class.fill_packages(old_bl, old_packages, :fullname)
|
||||
}
|
||||
build_list_ids << bl.id
|
||||
|
|
Loading…
Reference in New Issue