Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specific message when canceling an already canceled job #15

Closed
wants to merge 4 commits into from

Conversation

lrodri29
Copy link
Member

@lrodri29 lrodri29 commented Sep 12, 2018

This fixes #3
If job is already canceled an appropriate message will be displayed.
(Did this really quickly since I noticed the issue)

@sandyhider
Copy link
Member

What happened when someone cancelled an already cancelled job before you made these changes?

@lrodri29
Copy link
Member Author

Checkout #3

@@ -229,6 +229,15 @@ def main(configuration=None, parser_args=None):

if args.cancel:
# Trying to cancel
boss_backend_params = {"client": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've hardcoded the backend properties. We'll need to pull them from the json file passed in on the commandline.

@lrodri29
Copy link
Member Author

@sandyhider you were right, I also realized that when not specifying an config file and defaulting to our production boss, I hadn't included the message. So I added that as well.

@@ -479,6 +479,8 @@ def get_job_status(self, ingest_job_id):
r = requests.get('{}/{}/ingest/{}/status'.format(self.host, self.api_version, ingest_job_id),
headers=self.api_headers, verify=self.validate_ssl)

if r.text == '{"status": 404, "code": 2004, "message": "The job with id %s has been deleted"}' % (ingest_job_id):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should fix the response from the endpoint so it returns a normal 200 with the status set properly instead of a 404. Currently, we don't match our docs when getting status for a deleted job: https://theboss.readme.io/docs/get-ingest-job-status

Then in client.py, you can do a normal get_job_status() call.

Fix would be here: https://github.com/jhuapl-boss/boss/blob/08a0ddb86b7dedf1c0b029d9479db0dc2b11ff1a/django/bossingest/views.py#L362

@lrodri29 lrodri29 closed this Jun 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants