1
0
Fork 0

Coerce `--concurrent-requests`/`-r` to type int

It comes through from the environment variable as a string. Fixes this
unhelpful error message:

`TypeError: '<' not supported between instances of 'str' and 'int'`
This commit is contained in:
David Lord 2018-06-12 19:50:36 +10:00 committed by David Lord
parent 25a3405192
commit af453e6f39
1 changed files with 1 additions and 0 deletions

View File

@ -39,6 +39,7 @@ def _argparse():
parser.add_argument(
'--concurrent-requests', '-r',
default=os.getenv('CONCURRENT_REQUESTS', 200),
type=int,
help='Maximum concurrent requests. Defaults to the $CONCURRENT_REQUESTS environment variable or 200.'
)
args = parser.parse_args()