Skip to content

Commit

Permalink
Merge pull request #68 from ginkgobioworks/ro-server-checks-indices-e…
Browse files Browse the repository at this point in the history
…xist

if server is a ro server, and requires location index or genome DB, f…
  • Loading branch information
benjiec committed Sep 30, 2021
2 parents 4f54871 + 5d8f7c8 commit ef5461a
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit ef5461a

Please sign in to comment.