delete: unnecessary code

This commit is contained in:
kostas 2024-08-07 16:19:54 +02:00
parent 2b79a13a8c
commit 952c29051f
2 changed files with 2 additions and 9 deletions

View File

@ -913,8 +913,7 @@ def create_batch_of_csv_files():
# sort csv files by creation time
csv_files.sort(key=lambda x: os.path.getctime(os.path.join(CSV_DIR, x)))
# keep the 30 MOST RECENT FILES
#recent_csv_files = csv_files[-30:] if len(csv_files) > 30 else csv_files
# keep the 600 MOST RECENT FILES
recent_csv_files = csv_files[-600:] if len(csv_files) > 600 else csv_files
# get the name of the first csv file
@ -1066,11 +1065,6 @@ def manage_csv_files(directory_path, max_files=20):
file_to_delete = os.path.join(directory_path, csv_files.pop(0))
os.remove(file_to_delete)
def serialize_for_csv(value):
if isinstance(value, (dict, list, tuple)):
return json.dumps(value, ensure_ascii=False)
return str(value)
def insert_id(path, id_number):
parts = path.split("/")
insert_position = parts.index("Devices") + 1

View File

@ -588,8 +588,7 @@ def create_batch_of_csv_files():
# sort csv files by creation time
csv_files.sort(key=lambda x: os.path.getctime(os.path.join(CSV_DIR, x)))
# keep the 30 MOST RECENT FILES
#recent_csv_files = csv_files[-30:] if len(csv_files) > 30 else csv_files
# keep the 600 MOST RECENT FILES
recent_csv_files = csv_files[-600:] if len(csv_files) > 600 else csv_files
# get the name of the first csv file