Fix --sleep-interval

Bug in d1b5f70bc9

Closes #3012
This commit is contained in:
pukkandan 2022-03-10 11:38:34 +05:30
parent 51c22ef4e2
commit 07ff290dce
No known key found for this signature in database
GPG Key ID: 7EEE9E1E817D0A39

View File

@ -198,10 +198,13 @@ def validate_options(opts):
validate_positive('requests sleep interval', opts.sleep_interval_requests)
validate_positive('sleep interval', opts.sleep_interval)
validate_positive('max sleep interval', opts.max_sleep_interval)
if opts.max_sleep_interval is not None:
if opts.sleep_interval is None:
validate(
opts.sleep_interval is not None, 'min sleep interval',
opts.max_sleep_interval is None, 'min sleep interval',
msg='{name} must be specified; use --min-sleep-interval')
elif opts.max_sleep_interval is None:
opts.max_sleep_interval = opts.sleep_interval
else:
validate_minmax(opts.sleep_interval, opts.max_sleep_interval, 'sleep interval')
if opts.wait_for_video is not None: