Skip to content

Commit

Permalink
Merge pull request #298 from valory-xyz/fix/rename_invalid_services
Browse files Browse the repository at this point in the history
Rename instead of delete invalid services
  • Loading branch information
truemiller authored Aug 28, 2024
2 parents f6439a5 + a153a4b commit 8207a61
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions operate/services/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,13 @@ 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 8207a61

Please sign in to comment.