Skip to content

Commit 29b2fce

Browse files
committed
CLI: limit --workers to 1 for free trial accounts
1 parent 26f081b commit 29b2fce

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

opencage/batch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ async def geocode(self, input, output):
2727
if test['error']:
2828
self.log(test['error'])
2929
return
30+
if test['free'] is True and self.options.workers > 1:
31+
sys.stderr.write(f"Free trial account detected. Resetting number of workers to 1.\n")
32+
self.options.workers = 1
3033

3134
if self.options.headers:
3235
header_columns = next(input, None)

0 commit comments

Comments
 (0)