[SCM] morituri/master: retry reading toc 3 times, often fails after loading

js at users.alioth.debian.org js at users.alioth.debian.org
Sun Oct 19 20:09:54 UTC 2014


The following commit has been merged in the master branch:
commit 298f13432a3079c374f53debb06f032f5d4fe2e8
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Sun Jan 20 20:02:46 2013 +0100

    retry reading toc 3 times, often fails after loading

diff --git a/morituri/rip/cd.py b/morituri/rip/cd.py
index 3edd585..ebe8283 100644
--- a/morituri/rip/cd.py
+++ b/morituri/rip/cd.py
@@ -146,8 +146,18 @@ Log files will log the path to tracks relative to this directory.
         # first, read the normal TOC, which is fast
         ptoc = cache.Persister(self.options.toc_pickle or None)
         if not ptoc.object:
-            t = cdrdao.ReadTOCTask(device=device)
-            function(runner, t)
+            tries = 0
+            while True:
+                tries += 1
+                t = cdrdao.ReadTOCTask(device=device)
+                try:
+                    function(runner, t)
+                    break
+                except:
+                    if tries > 3:
+                        raise
+                    self.debug('failed to read TOC after %d tries, retrying' % tries)
+
             version = t.tasks[1].parser.version
             from pkg_resources import parse_version as V
             # we've built a cdrdao 1.2.3rc2 modified package with the patch

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list