feat: move failing pipelines to failed dir

This commit is contained in:
Timothy J. Baek 2024-06-02 18:49:26 -07:00
parent d0cf5b7bcb
commit 72ed9c537c

View File

@ -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