summaryrefslogtreecommitdiffstats
path: root/stator/management/commands
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-27 11:03:52 -0700
committerAndrew Godwin2022-11-27 11:03:52 -0700
commit263af996d8ed05e37ef5a62c6ed240216a6eb67b (patch)
tree5790f7f3f2ac312f212220edd6c8f645dc3f35e4 /stator/management/commands
parent18c85bc6d24fc1015ff3a0288fd92aa7dbe71e02 (diff)
downloadtakahe-263af996d8ed05e37ef5a62c6ed240216a6eb67b.tar.gz
takahe-263af996d8ed05e37ef5a62c6ed240216a6eb67b.tar.bz2
takahe-263af996d8ed05e37ef5a62c6ed240216a6eb67b.zip
Add run-for option to console runstator
Diffstat (limited to 'stator/management/commands')
-rw-r--r--stator/management/commands/runstator.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/stator/management/commands/runstator.py b/stator/management/commands/runstator.py
index 3030960..4d52520 100644
--- a/stator/management/commands/runstator.py
+++ b/stator/management/commands/runstator.py
@@ -33,6 +33,13 @@ class Command(BaseCommand):
default=30,
help="How often to run cleaning and scheduling",
)
+ parser.add_argument(
+ "--run-for",
+ "-r",
+ type=int,
+ default=0,
+ help="How long to run for before exiting (defaults to infinite)",
+ )
parser.add_argument("model_labels", nargs="*", type=str)
def handle(
@@ -41,6 +48,7 @@ class Command(BaseCommand):
concurrency: int,
liveness_file: str,
schedule_interval: int,
+ run_for: int,
*args,
**options
):
@@ -60,5 +68,6 @@ class Command(BaseCommand):
concurrency=concurrency,
liveness_file=liveness_file,
schedule_interval=schedule_interval,
+ run_for=run_for,
)
async_to_sync(runner.run)()