Skip to content

Commit

Permalink
feat: move failing pipelines to failed dir
Browse files Browse the repository at this point in the history
  • Loading branch information
tjbck committed Jun 3, 2024
1 parent d0cf5b7 commit 72ed9c5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 72ed9c5

Please sign in to comment.