Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if server is a ro server, and requires location index or genome DB, f… #68

Merged
merged 4 commits into from
Sep 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/edge/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
from edge import import_gff
from edge.tasks import build_genome_blastdb, build_genome_fragment_indices

IS_RO_SERVER = os.getenv("RO_SERVER", False) == "True"


def genome_export(request, genome_id):
get_genome_or_404(genome_id)
Expand Down Expand Up @@ -584,6 +586,10 @@ def on_post(self, request, genome_id):
from edge.blastdb import check_and_build_genome_db

genome = get_genome_or_404(genome_id)

if IS_RO_SERVER and (not genome.has_location_index or not genome.blastdb):
return [], 409 # 409 is "Conflict" - caller is expected to retry request on RW server

check_and_build_genome_db(genome)

# always require a 'create' argument
Expand Down