From c006b5735eb94127fd8be304b70a6d3f78a763f0 Mon Sep 17 00:00:00 2001 From: Rabab Fatima Date: Mon, 1 Jul 2024 10:43:21 -0500 Subject: [PATCH] Working through this test, and debugging. --- backend/src/core/annotation.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/backend/src/core/annotation.py b/backend/src/core/annotation.py index 83068587..2803e4e6 100644 --- a/backend/src/core/annotation.py +++ b/backend/src/core/annotation.py @@ -97,9 +97,10 @@ def process_tasks(annotation_queue, genomic_unit_collection): # pylint: disable ) and annotation_unit.is_version_latest(): logger.info('%s Annotation Exists...', format_annotation_logging(annotation_unit)) latest = True + ready = True print("Reaching check to check if annotation exists and if version is latest") continue - ready = True + # ready = True print("Surpassed check to check if annotation exists and if version is latest ") if annotation_unit.has_dependencies(): @@ -111,7 +112,19 @@ def process_tasks(annotation_queue, genomic_unit_collection): # pylint: disable ) ready = annotation_unit.ready_for_annotation(annotation_value, missing) - if not ready and not latest: + if not latest: + version_task = AnnotationTaskFactory.create_version_task( + annotation_unit.genomic_unit, annotation_unit.dataset + ) + logger.info('%s Creating Task To Version...', format_annotation_logging(annotation_unit)) + annotation_task_futures[executor.submit(version_task.annotate) + ] = (annotation_unit.genomic_unit, version_task) + + # annotation_queue.put(annotation_unit) + + continue + + if not ready: print("Reaching check to check if annotation unit is not ready and not latest") if annotation_unit.should_continue_annotation(): logger.info( @@ -127,14 +140,6 @@ def process_tasks(annotation_queue, genomic_unit_collection): # pylint: disable continue - if not latest: - version_task = AnnotationTaskFactory.create_version_task( - annotation_unit.genomic_unit, annotation_unit.dataset - ) - logger.info('%s Creating Task To Version...', format_annotation_logging(annotation_unit)) - annotation_task_futures[executor.submit(version_task.annotate) - ] = (annotation_unit.genomic_unit, version_task) - task = AnnotationTaskFactory.create_annotation_task( annotation_unit.genomic_unit, annotation_unit.dataset )