Skip to content

Commit

Permalink
MetaQuast no-ref: 1-sec delay if NCBI is not responding #8
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeigurevich committed Feb 7, 2019
1 parent 1982c29 commit 32a76ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions quast_libs/search_references_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import shlex
import shutil
import re
import time
from collections import defaultdict

from os.path import isdir, isfile, join
Expand Down Expand Up @@ -80,6 +81,9 @@ def try_send_request(url):
logger.error('Cannot established internet connection to download reference genomes! '
'Check internet connection or run MetaQUAST with option "--max-ref-number 0".', exit_with_code=404)
return None
# NCBI recommends users post no more than three URL requests per second, so adding artificial 1-sec delay
# see more: https://github.com/ablab/quast/issues/8
time.sleep(1)
return response


Expand Down

0 comments on commit 32a76ec

Please sign in to comment.