[SCM] ci-tooling packaging branch, master, updated. ec6dad0a211d1db457b6aea0388f2d61b11cece8

Harald Sitter apachelogger-guest at moszumanska.debian.org
Fri Mar 13 09:01:14 UTC 2015


Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=ec6dad0

The following commit has been merged in the master branch:
commit ec6dad0a211d1db457b6aea0388f2d61b11cece8
Author: Harald Sitter <sitter at kde.org>
Date:   Fri Mar 13 09:59:17 2015 +0100

    attempt to thread new ppa_promote
---
 kci/ppa_promote.rb | 57 +++++++++++++++++++++++++++++-------------------------
 1 file changed, 31 insertions(+), 26 deletions(-)

diff --git a/kci/ppa_promote.rb b/kci/ppa_promote.rb
index 193aace..b06bc19 100755
--- a/kci/ppa_promote.rb
+++ b/kci/ppa_promote.rb
@@ -5,8 +5,9 @@ require 'logger'
 require 'logger/colors'
 
 require_relative 'lib/lp'
+require_relative 'lib/thread_pool'
+require_relative 'lib/retry'
 
-# TODO: thread?
 # TODO: wait for wipe and publish to be done. fail if publish takes >40 minutes
 
 LOG = Logger.new(STDERR)
@@ -29,37 +30,41 @@ class Archive
     # We need to iter clear as Deleted entries would still retain their entry
     # making the unfiltered list grow larger and larger every time.
     %i(Pending Published Superseded Obsolete).each do |status|
-      @ppa.getPublishedSources(status: status,
-                               distro_series: @series).each do |source|
-        next if source.status == 'Deleted'
-        LOG.info "Requesting deletion of: #{source.source_package_name} from" \
-                 " #{@ppa.name}"
-        begin
-          source.requestDeletion!
-        rescue => e
-          LOG.warn 'failed to request deletion, retry'
-          puts e
-          sleep 1
-          retry
+      sources = @ppa.getPublishedSources(status: status,
+                                         distro_series: @series)
+      source_queue = Queue.new
+      sources.each { |s| source_queue << s }
+      BlockingThreadPool.run(8) do
+        until source_queue.empty?
+          source = source_queue.pop(true)
+          next if source.status == 'Deleted'
+          Retry.retry_it do
+            LOG.info "Requesting deletion of: #{source.source_package_name} " \
+                     " from #{@ppa.name}"
+            source.requestDeletion!
+          end
         end
       end
     end
   end
 
   def copy(packages, from_ppa)
-    packages.each do |package, version|
-      begin
-        LOG.info "Copying source: #{package} (#{version})"
-        @ppa.copyPackage!(from_archive: from_ppa.self_link,
-                          source_name: package,
-                          version: version,
-                          to_pocket: 'Release',
-                          include_binaries: true)
-      rescue => e
-        LOG.warn "Failed copy: #{package} (#{version}); retrying"
-        puts e
-        sleep 1
-        retry
+    source_queue = Queue.new
+    packages.each_pair { |a| source_queue << a }
+    BlockingThreadPool.run(8) do
+      until source_queue.empty?
+        entry = source_queue.pop(true)
+        source = entry[0]
+        version = entry[1]
+        Retry.retry_it do
+          LOG.info "Copying source: #{source} (#{version});" \
+                   " #{from_ppa.name} => #{@ppa.name}"
+          @ppa.copyPackage!(from_archive: from_ppa.self_link,
+                            source_name: source,
+                            version: version,
+                            to_pocket: 'Release',
+                            include_binaries: true)
+        end
       end
     end
   end

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list