mirror of
https://framagit.org/framasoft/framaspace/argos.git
synced 2025-04-28 18:02:41 +02:00
🩹 — Reintroduce validate_max_results and use it
This commit is contained in:
parent
13cd20ad96
commit
9fb6d7b078
1 changed files with 12 additions and 1 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue