|
|
@ -400,8 +400,9 @@ class Cutter(object):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TranscodeChecker(object):
|
|
|
|
class TranscodeChecker(object):
|
|
|
|
NO_VIDEOS_RETRY_INTERVAL = 5
|
|
|
|
NO_VIDEOS_RETRY_INTERVAL = 5 # can be fast because it's just a DB lookup
|
|
|
|
ERROR_RETRY_INTERVAL = 5
|
|
|
|
FOUND_VIDEOS_RETRY_INTERVAL = 20
|
|
|
|
|
|
|
|
ERROR_RETRY_INTERVAL = 20
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, youtube, dbmanager, stop):
|
|
|
|
def __init__(self, youtube, dbmanager, stop):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
@ -428,12 +429,11 @@ class TranscodeChecker(object):
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
self.logger.info("Found {} videos in TRANSCODING".format(len(ids)))
|
|
|
|
self.logger.info("Found {} videos in TRANSCODING".format(len(ids)))
|
|
|
|
ids = self.check_ids(ids)
|
|
|
|
ids = self.check_ids(ids)
|
|
|
|
if not ids:
|
|
|
|
if ids:
|
|
|
|
self.wait(self.NO_VIDEOS_RETRY_INTERVAL)
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
self.logger.info("{} videos are done".format(len(ids)))
|
|
|
|
self.logger.info("{} videos are done".format(len(ids)))
|
|
|
|
done = self.mark_done(ids)
|
|
|
|
done = self.mark_done(ids)
|
|
|
|
self.logger.info("Marked {} videos as done".format(done))
|
|
|
|
self.logger.info("Marked {} videos as done".format(done))
|
|
|
|
|
|
|
|
self.wait(self.FOUND_VIDEOS_RETRY_INTERVAL)
|
|
|
|
except Exception:
|
|
|
|
except Exception:
|
|
|
|
self.logger.exception("Error in TranscodeChecker")
|
|
|
|
self.logger.exception("Error in TranscodeChecker")
|
|
|
|
# To ensure a fresh slate and clear any DB-related errors, get a new conn on error.
|
|
|
|
# To ensure a fresh slate and clear any DB-related errors, get a new conn on error.
|
|
|
|