Fix overwrete logic for files based on modified date. Rationalise perform logic routines
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user