From 267bb70533745ab9b97ca0083870bad492c66c00 Mon Sep 17 00:00:00 2001 From: jmoreira-valory Date: Thu, 29 Aug 2024 11:59:57 +0200 Subject: [PATCH] chore: add timestamp to renamed folder --- operate/services/manage.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/operate/services/manage.py b/operate/services/manage.py index 675f06ae8..076701949 100644 --- a/operate/services/manage.py +++ b/operate/services/manage.py @@ -23,6 +23,7 @@ import logging import os import shutil +import time import traceback import typing as t from collections import Counter @@ -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}"