Skip to content

Commit

Permalink
Merge pull request #300 from valory-xyz/fix/rename_invalid_services
Browse files Browse the repository at this point in the history
Add timestamp to renamed invalid services
  • Loading branch information
jmoreira-valory authored Aug 29, 2024
2 parents 8207a61 + 267bb70 commit 2711e16
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion operate/services/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import logging
import os
import shutil
import time
import traceback
import typing as t
from collections import Counter
Expand Down Expand Up @@ -116,7 +117,8 @@ def json(self) -> t.List[t.Dict]:
f"Failed to load service: {path.name}. Exception: {e}"
)
# rename the invalid path
invalid_path = path.parent / f"invalid_{path.name}"
timestamp = int(time.time())
invalid_path = path.parent / f"invalid_{timestamp}_{path.name}"
os.rename(path, invalid_path)
self.logger.info(
f"Renamed invalid service: {path.name} to {invalid_path.name}"
Expand Down

0 comments on commit 2711e16

Please sign in to comment.