Skip to content

Commit

Permalink
Fetch live app info if no edit info is present
Browse files Browse the repository at this point in the history
  • Loading branch information
loremattei authored and Lorenzo Mattei committed Aug 22, 2023
1 parent 614eadf commit fbdfd35
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions deliver/lib/deliver/upload_metadata.rb
Expand Up @@ -222,7 +222,7 @@ def upload(options)
app_info_worker.start

# Update categories
app_info = fetch_edit_app_info(app)
app_info = fetch_edit_app_info(app) || fetch_live_app_info(app)
if app_info
category_id_map = {}

Expand Down Expand Up @@ -437,6 +437,12 @@ def fetch_edit_app_info(app, wait_time: 10)
end
end

def fetch_live_app_info(app, wait_time: 10)
retry_if_nil("Cannot find live app info", wait_time: wait_time) do
app.fetch_live_app_info
end
end

def retry_if_nil(message, tries: 5, wait_time: 10)
loop do
tries -= 1
Expand All @@ -453,7 +459,7 @@ def retry_if_nil(message, tries: 5, wait_time: 10)

# Finding languages to enable
def verify_available_info_languages!(options, app, languages)
app_info = fetch_edit_app_info(app)
app_info = fetch_edit_app_info(app) || fetch_live_app_info(app)

unless app_info
UI.user_error!("Cannot update languages - could not find an editable info")
Expand Down

0 comments on commit fbdfd35

Please sign in to comment.