Skip to content

Commit 63f8883

Browse files
committed
rename stuff
1 parent cbb4adf commit 63f8883

File tree

2 files changed

+7
-5
lines changed
  • scripts/maintenance/computational-clusters/autoscaled_monitor

2 files changed

+7
-5
lines changed

scripts/maintenance/computational-clusters/autoscaled_monitor/cli.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def cancel_jobs(
155155
typer.Option(help="the wallet ID"),
156156
] = None,
157157
*,
158-
force: Annotated[
158+
abort_in_db: Annotated[
159159
bool,
160160
typer.Option(
161161
help="will also force the job to abort in the database (use only if job is in WAITING FOR CLUSTER/WAITING FOR RESOURCE)"
@@ -169,8 +169,9 @@ def cancel_jobs(
169169
Keyword Arguments:
170170
user_id -- the user ID
171171
wallet_id -- the wallet ID
172+
abort_in_db -- will also force the job to abort in the database (use only if job is in WAITING FOR CLUSTER/WAITING FOR RESOURCE)
172173
"""
173-
asyncio.run(api.cancel_jobs(state, user_id, wallet_id, force=force))
174+
asyncio.run(api.cancel_jobs(state, user_id, wallet_id, abort_in_db=abort_in_db))
174175

175176

176177
@app.command()
@@ -185,6 +186,7 @@ def trigger_cluster_termination(
185186
Keyword Arguments:
186187
user_id -- the user ID
187188
wallet_id -- the wallet ID
189+
force -- will not ask for confirmation (VERY RISKY! USE WITH CAUTION!)
188190
"""
189191
asyncio.run(api.trigger_cluster_termination(state, user_id, wallet_id, force=force))
190192

scripts/maintenance/computational-clusters/autoscaled_monitor/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ async def _get_db_task_to_dask_job(
620620

621621

622622
async def cancel_jobs( # noqa: C901, PLR0912
623-
state: AppState, user_id: int, wallet_id: int | None, *, force: bool
623+
state: AppState, user_id: int, wallet_id: int | None, *, abort_in_db: bool
624624
) -> None:
625625
# get the theory
626626
computational_tasks = await db.list_computational_tasks_from_db(state, user_id)
@@ -661,7 +661,7 @@ async def cancel_jobs( # noqa: C901, PLR0912
661661
state,
662662
the_cluster,
663663
task_to_dask_job=task_to_dask_job,
664-
abort_in_db=force,
664+
abort_in_db=abort_in_db,
665665
)
666666
else:
667667
try:
@@ -685,7 +685,7 @@ async def cancel_jobs( # noqa: C901, PLR0912
685685
state, the_cluster, dask_task.job_id
686686
)
687687

688-
if comp_task is not None and force:
688+
if comp_task is not None and abort_in_db:
689689
await db.abort_job_in_db(
690690
state, comp_task.project_id, comp_task.node_id
691691
)

0 commit comments

Comments
 (0)