🩹 — Reintroduce validate_max_results and use it

This commit is contained in:
Luc Didry 2023-12-18 08:22:37 +01:00
parent 13cd20ad96
commit 9fb6d7b078
No known key found for this signature in database
GPG key ID: EA868E12D0257E3C

View file

@ -92,8 +92,19 @@ def validate_max_lock_seconds(ctx, param, value):
return value return value
def validate_max_results(ctx, param, value):
if value <= 0:
raise click.BadParameter("Should be a positive integer")
return value
@server.command() @server.command()
@click.option("--max-results", default=100, help="Number of results per task to keep") @click.option(
"--max-results",
default=100,
help="Number of results per task to keep",
callback=validate_max_results,
)
@click.option( @click.option(
"--max-lock-seconds", "--max-lock-seconds",
default=100, default=100,