Fix last commit

This commit is contained in:
Wedge 2018-09-03 23:30:12 +03:00
parent 092dc59806
commit 097431d19a
1 changed files with 9 additions and 3 deletions

View File

@ -1,4 +1,10 @@
module AbfWorkerService module AbfWorkerService
class Base class Base
REDIS_MAIN_KEY = 'abf-worker::build-lists-publish-task-manager::' REDIS_MAIN_KEY = 'abf-worker::build-lists-publish-task-manager::'
@ -66,12 +72,12 @@ module AbfWorkerService
ids = [] ids = []
build_lists = build_lists.flatten.select do |build_list| build_lists = build_lists.flatten.select do |build_list|
sha1 = nil sha1 = nil
TRIES.times do TRIES.times do |i|
sha1 = build_list.packages.pluck(:sha1).find do |sha1| sha1 = build_list.packages.pluck(:sha1).find do |sha1|
!FileStoreService::File.new(sha1: sha1).exist? !FileStoreService::File.new(sha1: sha1).exist?
end end
break if sha1.present? break if !sha1.present?
sleep 1 sleep 2**i
end end
if sha1.present? if sha1.present?
ids << build_list.id ids << build_list.id