Skip to content

Commit

Permalink
fix(connectin): fix too many connections (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
giangbui authored Dec 14, 2020
1 parent a1d4528 commit 5d27dd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion covid19-etl/etl/ncbi.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ def _get_response_from_big_query(self, accession_numbers):

start = 0
offset = 100
client = bigquery.Client()
while start < len(accession_numbers):
end = min(start + offset, len(accession_numbers))
stm = 'SELECT * FROM `nih-sra-datastore`.sra.metadata where consent = "public"'
Expand All @@ -570,7 +571,6 @@ def _get_response_from_big_query(self, accession_numbers):
stm = stm + f' or acc = "{accession_number}"'
stm = stm + ")"

client = bigquery.Client()
query_job = client.query(stm)

results = query_job.result() # Waits for job to complete.
Expand Down

0 comments on commit 5d27dd0

Please sign in to comment.