Skip to content
Snippets Groups Projects
Commit 145de0ba authored by Nico Vermaas's avatar Nico Vermaas
Browse files

Merge branch 'SDC-470' into 'master'

SDC-470: Fixes after local testing

See merge request !161
parents a6c7d1bb 2c4ae5c0
No related branches found
No related tags found
4 merge requests!164Master,!163SDC-470: Create api-function to retrieve the minimum start time and maximum...,!162Master,!161SDC-470: Fixes after local testing
Pipeline #24076 passed
...@@ -15,7 +15,7 @@ DATABASES = { ...@@ -15,7 +15,7 @@ DATABASES = {
'PASSWORD': 'atdb123', 'PASSWORD': 'atdb123',
'NAME': 'atdb_ldv', 'NAME': 'atdb_ldv',
'HOST': 'localhost', 'HOST': 'localhost',
'PORT': '', 'PORT': '5432',
}, },
} }
......
...@@ -52,12 +52,14 @@ def get_min_start_and_max_end_time(sas_id): ...@@ -52,12 +52,14 @@ def get_min_start_and_max_end_time(sas_id):
min_start_time = None min_start_time = None
max_end_time = None max_end_time = None
logger.info("get_min_start_and_max_end_time(" + str(sas_id) + ")") logger.info("get_min_start_and_max_end_time(" + str(sas_id) + ")")
tasks = Task.objects.filter(sas_id=sas_id).filter(status__in='archived,finished') tasks = Task.objects.filter(sas_id=sas_id).filter(Q(status='archived') | Q(status='finished'))
for task in tasks: for task in tasks:
# If more entrees are found for 'processing' task, get the latest # If more entrees are found for 'processing' task, get the latest
start_time = LogEntry.objects.filter(task=task.pk).filter(step_name='running').filter(status='processing').lastest('timestamp').timestamp latest_start_time = LogEntry.objects.filter(task=task.pk).filter(step_name='running').filter(status='processing').latest('timestamp')
start_time = latest_start_time.timestamp
# If more entrees are found for 'processed' task, get the latest # If more entrees are found for 'processed' task, get the latest
end_time = LogEntry.objects.filter(task=task.pk).filter(step_name='running').filter(status='processed').lastest('timestamp').timestamp lastest_end_time = LogEntry.objects.filter(task=task.pk).filter(step_name='running').filter(status='processed').latest('timestamp')
end_time = lastest_end_time.timestamp
if min_start_time is None: if min_start_time is None:
min_start_time = start_time min_start_time = start_time
elif start_time < min_start_time: elif start_time < min_start_time:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment