@@ -83,22 +83,26 @@ def run_transcription_ingestion_pipeline_worker(
8383 """
8484 Run the transcription ingestion pipeline in a separate thread
8585 """
86- try :
87- callback = TranscriptionIngestionStatus (
88- run_id = dto .settings .authentication_token ,
89- base_url = dto .settings .artemis_base_url ,
90- initial_stages = dto .initial_stages ,
91- lecture_id = dto .lectureId ,
92- )
93- db = VectorDatabase ()
94- client = db .get_client ()
95- pipeline = TranscriptionIngestionPipeline (
96- client = client , dto = dto , callback = callback
97- )
98- pipeline ()
99- except Exception as e :
100- logger .error (f"Error while deleting lectures: { e } " )
101- logger .error (traceback .format_exc ())
86+ with semaphore :
87+ try :
88+ callback = TranscriptionIngestionStatus (
89+ run_id = dto .settings .authentication_token ,
90+ base_url = dto .settings .artemis_base_url ,
91+ initial_stages = dto .initial_stages ,
92+ lecture_id = dto .lectureId
93+ )
94+ db = VectorDatabase ()
95+ client = db .get_client ()
96+ pipeline = TranscriptionIngestionPipeline (
97+ client = client , dto = dto , callback = callback
98+ )
99+ pipeline ()
100+ except Exception as e :
101+ logger .error (f"Error while deleting lectures: { e } " )
102+ logger .error (traceback .format_exc ())
103+ capture_exception (e )
104+ finally :
105+ semaphore .release ()
102106
103107
104108def run_faq_update_pipeline_worker (dto : FaqIngestionPipelineExecutionDto ):
0 commit comments