From 72ed9c537c270a6434d044e4a441cf2cc7f8dc58 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 2 Jun 2024 18:49:26 -0700 Subject: [PATCH] feat: move failing pipelines to failed dir --- main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.py b/main.py index 0bb917f..04626fd 100644 --- a/main.py +++ b/main.py @@ -118,6 +118,14 @@ async def load_module_from_path(module_name, module_path): raise Exception("No Pipeline class found") except Exception as e: print(f"Error loading module: {module_name}") + + # Move the file to the error folder + failed_pipelines_folder = os.path.join(PIPELINES_DIR, "failed") + if not os.path.exists(failed_pipelines_folder): + os.makedirs(failed_pipelines_folder) + + failed_file_path = os.path.join(failed_pipelines_folder, f"{module_name}.py") + os.rename(module_path, failed_file_path) print(e) return None