[options] add 'sleep-retries' option

This commit is contained in:
Mike Fährmann
2026-02-13 18:04:05 +01:00
parent e6f2e31d45
commit d2477a94af
5 changed files with 72 additions and 26 deletions

View File

@@ -590,14 +590,20 @@ def build_parser():
help=("Number of seconds to wait between HTTP requests "
"during data extraction"),
)
sleep.add_argument(
"--sleep-retries",
dest="sleep-retries", metavar="[TYPE=]SECONDS", action=ConfigAction,
help=("Number of seconds to wait before retrying an HTTP request. "
"Can be prefixed with "
"'lin[:START[:MAX]]' or 'exp[:BASE[:START[:MAX]]]' "
"for linear or exponential growth between consecutive retries "
"(e.g. '30', 'exp=40', 'lin:20=30-60'"),
)
sleep.add_argument(
"--sleep-429",
dest="sleep-429", metavar="[TYPE=]SECONDS", action=ConfigAction,
help=("Number of seconds to wait when receiving a "
"'429 Too Many Requests' response. Can be prefixed with "
"'lin[:START[:MAX]]' or 'exp[:BASE[:START[:MAX]]]' "
"for linear or exponential growth "
"(e.g. '30', 'exp=40', 'lin:20=30-60'"),
"'429 Too Many Requests' response"),
)
configuration = parser.add_argument_group("Configuration Options")