Fix overwrete logic for files based on modified date. Rationalise perform logic routines

This commit is contained in:
2024-12-01 11:05:35 +00:00
parent ce91fbab45
commit bae566758c
12 changed files with 133 additions and 220 deletions

View File

@@ -393,7 +393,7 @@ def check_file_version(filename,force_Files=False):
#
if force_Files:
return filename
ThresholdSecs = 3 #allow secs since creation date before treat as changed.
ThresholdSecs = 70 #allow secs since creation date before treat as changed.
try:
with open(filename, 'r') as file:
# Read the first three lines
@@ -419,6 +419,7 @@ def check_file_version(filename,force_Files=False):
# Get the last modified time of the file, ignoring milliseconds
file_modified_time = datetime.fromtimestamp(os.path.getmtime(filename)).replace(microsecond=0)
logger.debug(f"{filename} - created:{timestamp_str} - modified:{file_modified_time.strftime('%Y-%m-%d %H:%M:%S')}")
# Compare the timestamps
if file_modified_time > file_timestamp: