From e11be449e8644b812e93d55b6655488ff2cf9337 Mon Sep 17 00:00:00 2001 From: msramalho <19508417+msramalho@users.noreply.github.com> Date: Wed, 10 May 2023 18:57:17 +0100 Subject: [PATCH] fix: delete completed whisper tasks --- src/auto_archiver/enrichers/whisper_enricher.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/auto_archiver/enrichers/whisper_enricher.py b/src/auto_archiver/enrichers/whisper_enricher.py index 5737c1c..61a0870 100644 --- a/src/auto_archiver/enrichers/whisper_enricher.py +++ b/src/auto_archiver/enrichers/whisper_enricher.py @@ -116,6 +116,9 @@ class WhisperEnricher(Enricher): if not len(subtitle): continue if self.include_srt: result[f"artifact_{art_id}_subtitle"] = "\n".join(subtitle) result[f"artifact_{art_id}_text"] = "\n".join(full_text) + # call /delete endpoint on timely success + r_del = requests.delete(f'{self.api_endpoint}/jobs/{job_id}', headers={'Authorization': f'Bearer {self.api_key}'}) + logger.debug(f"DELETE whisper {job_id=} result: {r_del.status_code}") return result return False