diff --git a/python/magaox/db/ingest.py b/python/magaox/db/ingest.py index 211d1b39c..fdea85c5b 100644 --- a/python/magaox/db/ingest.py +++ b/python/magaox/db/ingest.py @@ -82,8 +82,16 @@ def identify_non_ingested_telem(cur: psycopg.Cursor, host: str) -> list[str]: LEFT JOIN file_ingest_times fit ON fi.origin_host = fit.origin_host AND fi.origin_path = fit.origin_path -WHERE fit.origin_host IS NULL AND - fit.origin_path IS NULL AND +WHERE + ( + ( + fit.origin_host IS NULL AND + fit.origin_path IS NULL + ) OR ( + fit.ingested_at < fi.modification_time + ) + ) + AND fi.origin_host = %s AND fi.origin_path LIKE '%%.bintel' ;