Skip to content

Commit

Permalink
Bug: whipper shouldn't abort if track rip succeeds on last allowed re…
Browse files Browse the repository at this point in the history
…try attempt

Fixes #449.

Signed-off-by: JoeLametta <[email protected]>
  • Loading branch information
JoeLametta committed Jan 14, 2020
1 parent 9e37219 commit caa2c8b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions whipper/command/cd.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,12 @@ def _ripIfNotRipped(number):

if not os.path.exists(path):
logger.debug('path %r does not exist, ripping...', path)
tries = 0
# we reset durations for test and copy here
trackResult.testduration = 0.0
trackResult.copyduration = 0.0
extra = ""
while tries < MAX_TRIES:
tries += 1
tries = 1
while tries <= MAX_TRIES:
if tries > 1:
extra = " (try %d)" % tries
logger.info('ripping track %d of %d%s: %s',
Expand All @@ -440,8 +439,10 @@ def _ripIfNotRipped(number):
# FIXME: catching too general exception (Exception)
except Exception as e:
logger.debug('got exception %r on try %d', e, tries)
tries += 1

if tries == MAX_TRIES:
if tries > MAX_TRIES:
tries -= 1
logger.critical('giving up on track %d after %d times',
number, tries)
raise RuntimeError(
Expand Down

0 comments on commit caa2c8b

Please sign in to comment.