Skip to content

Commit

Permalink
Make export task wait on analysis node
Browse files Browse the repository at this point in the history
  • Loading branch information
davmlaw committed Sep 19, 2024
1 parent a7f4da8 commit 6b3f894
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 4 additions & 1 deletion analysis/tasks/analysis_grid_export_tasks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import gzip
import logging
import os
import uuid
import zipfile
from typing import Optional

Expand All @@ -13,6 +12,7 @@
from analysis.analysis_templates import get_cohort_analysis, get_sample_analysis
from analysis.grid_export import node_grid_get_export_iterator
from analysis.models import AnalysisTemplate, SampleNode
from analysis.tasks.node_update_tasks import wait_for_node
from library.django_utils import FakeRequest
from library.guardian_utils import admin_bot
from library.utils import name_from_filename, sha256sum_str, mk_path_for_file
Expand Down Expand Up @@ -106,6 +106,9 @@ def export_cohort_to_downloadable_file(cohort_id, export_type):
analysis_template = AnalysisTemplate.get_template_from_setting("ANALYSIS_TEMPLATES_AUTO_COHORT_EXPORT")
analysis = get_cohort_analysis(cohort, analysis_template)
node = analysis.analysisnode_set.get_subclass(output_node=True) # Should only be 1
if not node.ready:
wait_for_node(node.pk) # Needs to be ready
node = node.get_subclass() # Easy way to reload
_write_node_to_cached_generated_file(cgf, analysis, node, cohort.name, export_type)


Expand Down
1 change: 0 additions & 1 deletion analysis/views/views_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from django.contrib.postgres.aggregates.general import StringAgg
from django.core.cache import cache
from django.http import JsonResponse
from django.http.response import StreamingHttpResponse, HttpResponseRedirect
from django.shortcuts import redirect
from django.urls import reverse
Expand Down
3 changes: 1 addition & 2 deletions snpdb/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
from analysis.analysis_templates import get_sample_analysis
from analysis.forms import AnalysisOutputNodeChoiceForm
from analysis.models import AnalysisTemplate
from analysis.tasks.analysis_grid_export_tasks import get_grid_downloadable_file_params_hash, \
get_annotated_download_files_cgf
from analysis.tasks.analysis_grid_export_tasks import get_annotated_download_files_cgf
from annotation.forms import GeneCountTypeChoiceForm
from annotation.manual_variant_entry import create_manual_variants, can_create_variants
from annotation.models import AnnotationVersion, SampleVariantAnnotationStats, SampleGeneAnnotationStats, \
Expand Down

0 comments on commit 6b3f894

Please sign in to comment.