Skip to content

Commit e722a4e

Browse files
committed
Fix: don't use outdated results
this can happen as long as the version column is still in the db Signed-off-by: Matthias Büchse <matthias.buechse@alasca.cloud>
1 parent edd6d9e commit e722a4e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

compliance-monitor/monitor.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,11 @@ def convert_result_rows_to_dict2(
521521
lifetime = testcase.get('lifetime') # leave None if not present; to be handled by add_period
522522
if now >= add_period(checked_at, lifetime):
523523
continue
524-
tc_result = dict(result=result, checked_at=checked_at)
524+
# don't use outdated value (FIXME only necessary as long as version column still in db!)
525+
tc_result = preliminary[subject][scope_uuid].get(testcase_id, {})
526+
if tc_result.get('checked_at', checked_at) > checked_at:
527+
continue
528+
tc_result.update(result=result, checked_at=checked_at)
525529
if include_report:
526530
tc_result.update(report=report_uuid)
527531
preliminary[subject][scope_uuid][testcase_id] = tc_result

0 commit comments

Comments
 (0)