Commit 07f1dea5 by Gregory Martin Committed by GitHub

Merge pull request #6 from edx/yro/cleanup-bugfix

fix ingest crash
parents b9996125 388587c0
...@@ -40,6 +40,8 @@ import celeryapp ...@@ -40,6 +40,8 @@ import celeryapp
time_safetygap = datetime.datetime.utcnow().replace(tzinfo=utc) - timedelta(days=1) time_safetygap = datetime.datetime.utcnow().replace(tzinfo=utc) - timedelta(days=1)
# TODO: make a checklist of these if e != 'mobile_high' and e != 'audio_mp3' and e != 'review' and e != 'hls':
class VedaHeal(): class VedaHeal():
""" """
...@@ -59,7 +61,7 @@ class VedaHeal(): ...@@ -59,7 +61,7 @@ class VedaHeal():
self.video_query = kwargs.get('video_query', None) self.video_query = kwargs.get('video_query', None)
self.freezing_bug = kwargs.get('freezing_bug', True) self.freezing_bug = kwargs.get('freezing_bug', True)
self.val_status = None self.val_status = None
self.retry_barrier_hours = 48 self.retry_barrier_hours = 24
def _READ_AUTH(self): def _READ_AUTH(self):
if self.auth_yaml is None: if self.auth_yaml is None:
...@@ -157,7 +159,7 @@ class VedaHeal(): ...@@ -157,7 +159,7 @@ class VedaHeal():
check_list = [] check_list = []
if encode_list is not None: if encode_list is not None:
for e in encode_list: for e in encode_list:
if e != 'mobile_high' and e != 'audio_mp3' and e != 'review': if e != 'mobile_high' and e != 'audio_mp3' and e != 'review' and e != 'hls':
check_list.append(e) check_list.append(e)
if check_list is None or len(check_list) == 0: if check_list is None or len(check_list) == 0:
...@@ -194,6 +196,7 @@ class VedaHeal(): ...@@ -194,6 +196,7 @@ class VedaHeal():
course_object=video_object.inst_class, course_object=video_object.inst_class,
) )
E2.determine_encodes() E2.determine_encodes()
E2.encode_list.remove('hls')
if len(E2.encode_list) == len(encode_list) and len(encode_list) > 1: if len(E2.encode_list) == len(encode_list) and len(encode_list) > 1:
""" """
Mark File Corrupt, accounting for migrated URLs Mark File Corrupt, accounting for migrated URLs
......
...@@ -89,7 +89,7 @@ class Output(object): ...@@ -89,7 +89,7 @@ class Output(object):
""" """
@staticmethod @staticmethod
def _seconds_from_string(duration): def _seconds_from_string(duration):
if duration == 0: if duration == 0 or duration is None:
return 0 return 0
hours = float(duration.split(':')[0]) hours = float(duration.split(':')[0])
minutes = float(duration.split(':')[1]) minutes = float(duration.split(':')[1])
......
...@@ -193,6 +193,12 @@ class VALAPICall(): ...@@ -193,6 +193,12 @@ class VALAPICall():
if not isinstance(self.video_proto.platform_course_url, list): if not isinstance(self.video_proto.platform_course_url, list):
self.video_proto.platform_course_url = [self.video_proto.platform_course_url] self.video_proto.platform_course_url = [self.video_proto.platform_course_url]
try:
self.video_object.video_orig_duration
except NameError:
self.video_object.video_orig_duration = 0
self.video_object.duration = 0.0
if not isinstance(self.video_proto.duration, float): if not isinstance(self.video_proto.duration, float):
self.video_proto.duration = Output._seconds_from_string( self.video_proto.duration = Output._seconds_from_string(
duration=self.video_object.video_orig_duration duration=self.video_object.video_orig_duration
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment