diff --git a/app/models/build_list.rb b/app/models/build_list.rb index f4a3260a4..5bf4216c4 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -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 diff --git a/lib/abf_worker/build_lists_publish_task_manager.rb b/lib/abf_worker/build_lists_publish_task_manager.rb index c98d6fcc5..2e4996695 100644 --- a/lib/abf_worker/build_lists_publish_task_manager.rb +++ b/lib/abf_worker/build_lists_publish_task_manager.rb @@ -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