Skip to content

Commit c389691

Browse files
committed
RHELMISC-7213: Fix share folder handle_exceptions
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 <vitalii@daynix.com>
1 parent 217a660 commit c389691

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/resultuploaders/dropbox/dropbox.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ def connect
118118
end
119119

120120
def create_project_folder
121+
@path = "/#{@repo}/CI/#{@tag}-#{@timestamp}"
122+
handle_exceptions(__method__) { @dropbox.create_folder(@path) }
121123
handle_exceptions(__method__) do
122-
@path = "/#{@repo}/CI/#{@tag}-#{@timestamp}"
123-
@dropbox.create_folder(@path)
124124
@dropbox.share_folder(@path)
125125
@url = "#{@dropbox.create_shared_link_with_settings(@path).url}&lst="
126126
@logger.info("Dropbox project folder created: #{@url}")

0 commit comments

Comments
 (0)