Skip to content

Commit

Permalink
allow shutdown queue_scheduled jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
houqp committed Mar 24, 2018
1 parent 4db4862 commit f05fb25
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions floyd/cli/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,15 @@ def stop(id):
except FloydException:
experiment = ExperimentClient().get(id)

if experiment.state not in ["queued", "running"]:
if experiment.state not in ["queued", "queue_scheduled", "running"]:
floyd_logger.info("Job in {} state cannot be stopped".format(experiment.state))
return
sys.exit(1)

if ExperimentClient().stop(experiment.id):
floyd_logger.info("Experiment shutdown request submitted. Check status to confirm shutdown")
else:
if not ExperimentClient().stop(experiment.id):
floyd_logger.error("Failed to stop job")
sys.exit(1)

floyd_logger.info("Experiment shutdown request submitted. Check status to confirm shutdown")


@click.command()
Expand Down

0 comments on commit f05fb25

Please sign in to comment.