Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion service/lib/agama/software/callbacks/media.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def media_change(error_code, error, url, product, current, current_label, wanted
# "IO" = IO error (scratched DVD or HW failure)
# "IO_SOFT" = network timeout
# in other cases automatic retry usually does not make much sense
if ["IO", "IO_SOFT"].include?(error_code) && attempt < Repository::RETRY_COUNT
if ["IO", "IO_SOFT"].include?(error_code) && attempt <= Repository::RETRY_COUNT
self.attempt += 1
logger.info("Retry in #{Repository::RETRY_DELAY} seconds, attempt #{attempt}...")
sleep(Repository::RETRY_DELAY)
Expand Down
6 changes: 3 additions & 3 deletions service/lib/agama/software/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Repository < Y2Packager::Repository
# delay before retrying (in seconds)
RETRY_DELAY = 5
# number of automatic retries
RETRY_COUNT = 3
RETRY_COUNT = 1

# Probes a repository
#
Expand All @@ -47,7 +47,7 @@ def probe
# on a timeout error the result is nil, retry automatically in that case,
# note: callbacks are disabled during repo probing call
type = Yast::Pkg.RepositoryProbe(url.to_s, product_dir)
break if !type.nil? || attempt == RETRY_COUNT
break if !type.nil? || attempt > RETRY_COUNT

sleep(RETRY_DELAY)
attempt += 1
Expand All @@ -65,7 +65,7 @@ def refresh

loop do
@loaded = !!super
break if @loaded || attempt == RETRY_COUNT
break if @loaded || attempt > RETRY_COUNT

sleep(RETRY_DELAY)
attempt += 1
Expand Down