Skip to content

Commit

Permalink
fix: rename instead of delete invalid services
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoreira-valory committed Aug 28, 2024
1 parent 8d28ba5 commit 1aba5f9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions operate/services/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@ def json(self) -> t.List[t.Dict]:
self.logger.warning(
f"Failed to load service: {path.name}. Exception: {e}"
)
# delete the invalid path
shutil.rmtree(path)
self.logger.info(f"Deleted invalid service: {path.name}")
# rename the invalid path
invalid_path = path.parent / f"invalid_{path.name}"
os.rename(path, invalid_path)
self.logger.info(f"Renamed invalid service: {path.name} to {invalid_path.name}")

return data

def exists(self, service: str) -> bool:
Expand Down

0 comments on commit 1aba5f9

Please sign in to comment.