deliver/lib/deliver/upload_screenshots.rb in fastlane-2.163.0 vs deliver/lib/deliver/upload_screenshots.rb in fastlane-2.164.0
- old
+ new
@@ -11,12 +11,10 @@
# upload screenshots to App Store Connect
class UploadScreenshots
DeleteScreenshotJob = Struct.new(:app_screenshot, :localization, :app_screenshot_set)
UploadScreenshotJob = Struct.new(:app_screenshot_set, :path)
- NUMBER_OF_THREADS = Helper.test? ? 1 : [ENV.fetch("DELIVER_NUMBER_OF_THREADS", 10).to_i, 10].min
-
def upload(options, screenshots)
return if options[:skip_screenshots]
return if options[:edit_live]
app = options[:app]
@@ -67,11 +65,11 @@
end
def delete_screenshots(localizations, screenshots_per_language, tries: 5)
tries -= 1
- worker = QueueWorker.new(NUMBER_OF_THREADS) do |job|
+ worker = QueueWorker.new do |job|
start_time = Time.now
target = "#{job.localization.locale} #{job.app_screenshot_set.screenshot_display_type} #{job.app_screenshot.id}"
begin
UI.verbose("Deleting '#{target}'")
job.app_screenshot.delete!
@@ -113,11 +111,11 @@
def upload_screenshots(localizations, screenshots_per_language, tries: 5)
tries -= 1
# Upload screenshots
- worker = QueueWorker.new(NUMBER_OF_THREADS) do |job|
+ worker = QueueWorker.new do |job|
begin
UI.verbose("Uploading '#{job.path}'...")
start_time = Time.now
job.app_screenshot_set.upload_screenshot(path: job.path, wait_for_processing: false)
UI.message("Uploaded '#{job.path}'... (#{Time.now - start_time} secs)")
@@ -234,10 +232,10 @@
def sort_screenshots(localizations)
iterator = AppScreenshotIterator.new(localizations)
# Re-order screenshots within app_screenshot_set
- worker = QueueWorker.new(NUMBER_OF_THREADS) do |app_screenshot_set|
+ worker = QueueWorker.new do |app_screenshot_set|
original_ids = app_screenshot_set.app_screenshots.map(&:id)
sorted_ids = app_screenshot_set.app_screenshots.sort_by(&:file_name).map(&:id)
if original_ids != sorted_ids
app_screenshot_set.reorder_screenshots(app_screenshot_ids: sorted_ids)
end