From 1a2737d06f82361d74ebb39862d594a2fa6e9ec9 Mon Sep 17 00:00:00 2001 From: Joel Mathew Thomas <90510078+joelmathewthomas@users.noreply.github.com> Date: Wed, 26 Feb 2025 18:01:31 +0530 Subject: [PATCH] remove redundant code --- api/api/tasks.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/api/api/tasks.py b/api/api/tasks.py index c50f6a1..74de546 100644 --- a/api/api/tasks.py +++ b/api/api/tasks.py @@ -36,7 +36,6 @@ def normalize_audio_task(file_path): export_audio(normalized_audio, file_path, sr) # Save file return True except Exception as e: - raise RuntimeError(f"RuntimeError: {e}") return False @shared_task @@ -48,7 +47,6 @@ def trim_audio_task(file_path): export_audio(trimmed_audio, file_path, sr) return True except Exception as e: - raise RuntimeError(f"RuntimeError: {e}") return False @shared_task @@ -60,7 +58,6 @@ def resample_audio_task(file_path, sr): export_audio(resampled_audio, file_path, sr) return True except Exception as e: - raise RuntimeError(f"RuntimeError: {e}") return False @shared_task @@ -110,13 +107,11 @@ def music_separation_task(file_path): return True except Exception as e: - raise RuntimeError(f"Music source separation task failed: {e}") - - return False + return False @shared_task def noisereduce_task(file_path): - """Celery task to remov noise from audio""" + """Celery task to remove noise from audio""" file_path = Path(file_path) # Run noisereduction @@ -124,5 +119,4 @@ def noisereduce_task(file_path): noisereduce(file_path, file_path) return True except Exception as e: - raise RuntimeError(f"Noise removal from audio failed") return False \ No newline at end of file