Clean up the code.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import os
|
||||
import datetime
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
@@ -12,6 +12,6 @@ def delete_files_older_than_one_day(directory):
|
||||
file_name = file_path.name
|
||||
file_modified_time = datetime.datetime.fromtimestamp(file_path.stat().st_mtime)
|
||||
time_difference = current_time - file_modified_time
|
||||
if time_difference.days > 1 and "placeholder" not in file_name:
|
||||
if time_difference.days > 1 and "placeholder" not in file_name:
|
||||
file_path.unlink()
|
||||
print(f"Deleted file: {file_path}")
|
||||
print(f"Deleted file: {file_path}")
|
||||
|
||||
Reference in New Issue
Block a user