From bdc457a470652e47e69fca02a2468a98e29bfc9e Mon Sep 17 00:00:00 2001 From: Gregory Martin Date: Wed, 2 May 2018 13:56:51 -0400 Subject: [PATCH] Change HEAL for legacy video encodes. --- control/veda_heal.py | 12 +++++++++++- control/veda_val.py | 11 ++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/control/veda_heal.py b/control/veda_heal.py index 542135f..7cce143 100644 --- a/control/veda_heal.py +++ b/control/veda_heal.py @@ -55,10 +55,20 @@ def discovery(self): hours=HEAL_END ) ) - + for v in self.video_query: + LOGGER.info('[HEAL] {studio_id} | {video_id}: Determining Missing Encodes'.format( + studio_id=v.studio_id, + video_id=v.edx_id, + )) self.send_encodes() def send_encodes(self): + """ + Unified function to enqueue videos with missing encodes + + Ingest/HEAL both call this function + """ + # TODO: Refactor to common location for v in self.video_query: encode_list = self.determine_fault(video_object=v) # Using the 'Video Proto' Model diff --git a/control/veda_val.py b/control/veda_val.py index fd44833..e060b20 100644 --- a/control/veda_val.py +++ b/control/veda_val.py @@ -237,10 +237,11 @@ def profile_determiner(self, val_api_return): """ # Defend against old/deprecated encodes - try: - self.auth_dict['val_profile_dict'][self.encode_profile] - except KeyError: - return + if self.encode_profile: + try: + self.auth_dict['val_profile_dict'][self.encode_profile] + except KeyError: + return if self.endpoint_url: for p in self.auth_dict['val_profile_dict'][self.encode_profile]: @@ -270,7 +271,7 @@ def profile_determiner(self, val_api_return): try: self.auth_dict['val_profile_dict'][final.encode_profile.product_spec] except KeyError: - return + continue for p in self.auth_dict['val_profile_dict'][final.encode_profile.product_spec]: test_list.append(dict( url=str(final.encode_url),