Skip to content

Commit

Permalink
RHELMISC-7213: Fix share folder handle_exceptions
Browse files Browse the repository at this point in the history
Fix retry behavior in handle_exceptions when share_folder fails.
Previously, when share_folder failed, handle_exceptions would retry
the entire block, attempting to create an already existing folder.
This led to unnecessary retries and potential errors.

Now the operations are separated:
- Folder creation has its own exception handling block
- Share folder and link generation are handled separately
- Prevents redundant folder creation attempts during retries

This ensures cleaner retry logic and proper error handling for
each operation independently.

Signed-off-by: Vitalii Chulak <[email protected]>
  • Loading branch information
Jedoku committed Feb 12, 2025
1 parent 217a660 commit c389691
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/resultuploaders/dropbox/dropbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ def connect
end

def create_project_folder
@path = "/#{@repo}/CI/#{@tag}-#{@timestamp}"
handle_exceptions(__method__) { @dropbox.create_folder(@path) }
handle_exceptions(__method__) do
@path = "/#{@repo}/CI/#{@tag}-#{@timestamp}"
@dropbox.create_folder(@path)
@dropbox.share_folder(@path)
@url = "#{@dropbox.create_shared_link_with_settings(@path).url}&lst="
@logger.info("Dropbox project folder created: #{@url}")
Expand Down

0 comments on commit c389691

Please sign in to comment.