Commit 79525b2a authored by Roque Porchetto's avatar Roque Porchetto

erp5_wendelin_telecom_ingestion: split ingestions are considered as abandoned after 24 hours

parent e5b3546e
......@@ -25,15 +25,15 @@ def getHash(data_stream):
def isInterruptedAbandonedSplitIngestion(reference):
from DateTime import DateTime
now = DateTime()
five_hours = 1.0/24/60*60*5
day_hours = 1.0/24/60*60*24
# started split data ingestions for reference
catalog_kw = {'portal_type': 'Data Ingestion',
'simulation_state': 'started',
'reference': reference}
invalidate = True
for data_ingestion in portal_catalog(**catalog_kw):
# check that all related ingestions are old (more than 5 hours)
if (DateTime() - data_ingestion.getCreationDate()) < five_hours:
# check that all related ingestions are old (more than 24 hours)
if (DateTime() - data_ingestion.getCreationDate()) < day_hours:
invalidate = False
return invalidate
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment