From 097431d19ac2a0b8fd1d4af766302d9465201c4d Mon Sep 17 00:00:00 2001 From: Wedge Date: Mon, 3 Sep 2018 23:30:12 +0300 Subject: [PATCH] Fix last commit --- app/services/abf_worker_service/base.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/services/abf_worker_service/base.rb b/app/services/abf_worker_service/base.rb index c5ce9f3ba..afe751213 100644 --- a/app/services/abf_worker_service/base.rb +++ b/app/services/abf_worker_service/base.rb @@ -1,4 +1,10 @@ module AbfWorkerService + + + + + + class Base REDIS_MAIN_KEY = 'abf-worker::build-lists-publish-task-manager::' @@ -66,12 +72,12 @@ module AbfWorkerService ids = [] build_lists = build_lists.flatten.select do |build_list| sha1 = nil - TRIES.times do + TRIES.times do |i| sha1 = build_list.packages.pluck(:sha1).find do |sha1| !FileStoreService::File.new(sha1: sha1).exist? end - break if sha1.present? - sleep 1 + break if !sha1.present? + sleep 2**i end if sha1.present? ids << build_list.id