Skip to content

Commit

Permalink
chore: add timestamp to renamed folder
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoreira-valory committed Aug 29, 2024
1 parent d5a2a0e commit 267bb70
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 267bb70

Please sign in to comment.