Skip to content

Commit

Permalink
Merge pull request #441 from nasark/exception_and_retry_ghost_tags
Browse files Browse the repository at this point in the history
VPC ghost tags exception with retry

(cherry picked from commit 25e4ec7)
  • Loading branch information
agrare authored and Fryguy committed Dec 20, 2022
1 parent 38037f0 commit 9189f53
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,16 @@ def volume_profiles
end

def tags_by_crn(crn)
vpc.cloudtools.tagging.collection(:list_tags, :attached_to => crn, :providers => ["ghost"]).to_a
retried = false
begin
vpc.cloudtools.tagging.collection(:list_tags, :attached_to => crn, :providers => ["ghost"]).to_a
rescue IBMCloudSdkCore::ApiException => err
raise if retried || !err.message.match?(/You must wait \d+ ms before you can make ghost-tags get api requests/)

sleep(5)
retried = true
retry
end
end

def database_instances
Expand Down

0 comments on commit 9189f53

Please sign in to comment.