fix: use epsilon comparison for mtime to prevent unnecessary re-mining (#610)
This commit is contained in:
+1
-1
@@ -67,7 +67,7 @@ def file_already_mined(collection, source_file: str, check_mtime: bool = False)
|
|||||||
if stored_mtime is None:
|
if stored_mtime is None:
|
||||||
return False
|
return False
|
||||||
current_mtime = os.path.getmtime(source_file)
|
current_mtime = os.path.getmtime(source_file)
|
||||||
return float(stored_mtime) == current_mtime
|
return abs(float(stored_mtime) - current_mtime) < 0.001
|
||||||
return True
|
return True
|
||||||
except Exception:
|
except Exception:
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user