Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

[Rest Server] Add get job api v2 #2851

Merged
merged 4 commits into from
Jun 5, 2019
Merged

[Rest Server] Add get job api v2 #2851

merged 4 commits into from
Jun 5, 2019

Conversation

abuccts
Copy link
Member

@abuccts abuccts commented May 29, 2019

Add get job api v2.

Add get job api v2.
Update.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.07%) to 53.242% when pulling be27abc on xiongyf/get-job-v2 into 8f76949 on master.

@coveralls
Copy link

coveralls commented May 29, 2019

Coverage Status

Coverage decreased (-0.1%) to 53.218% when pulling 4922f14 on xiongyf/get-job-v2 into 8f76949 on master.

Split not found error.
@abuccts abuccts requested a review from Binyang2014 May 30, 2019 03:20
if (response.status !== status('OK')) {
if (response.status === status('OK')) {
return response.data;
} else if (response.status === status('Not Found')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

remove else

if (status === statue('OK')) {
  return ...;
}

if (...) {
  throw ...
}

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

@@ -35,7 +35,7 @@ const update = asyncHandler(async (req, res) => {
throw createError('Conflict', 'ConflictJobError', `Job ${frameworkName} already exists.`);
}
} catch (error) {
if (error.code === 'UnknownError') {
if (error.code !== 'NoJobError') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can log this?

if (error.code === 'NoJobError') {
  log.Debug('...');
  return;
}

throw error;

Copy link
Member Author

Choose a reason for hiding this comment

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

it's not an error if job not found here, no need to log.

Update.
@abuccts abuccts merged commit 050fcc9 into master Jun 5, 2019
@abuccts abuccts deleted the xiongyf/get-job-v2 branch June 5, 2019 05:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants