delete: unnecessary code
This commit is contained in:
parent
2b79a13a8c
commit
952c29051f
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue