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

Added HealthInfo #327

Merged
merged 1 commit into from
Aug 18, 2023
Merged

Added HealthInfo #327

merged 1 commit into from
Aug 18, 2023

Conversation

Rajan-226
Copy link
Contributor

No description provided.

resp := h.svc.ApiInfoHealth(c.Request.Context())
c.JSON(http.StatusOK, resp)

return // why do we have explicit returns at end of function though?
Copy link
Contributor

Choose a reason for hiding this comment

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

oh it's just a convention to make it obvious. nothing too important.

func (s *serviceImpl) ApiInfoHealth(ctx context.Context) *iwfidl.HealthInfo {
return &iwfidl.HealthInfo{
Condition: iwfidl.PtrString("OK"),
Hostname: iwfidl.PtrString("will check"),
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice if you can use os.Hostname() to get the hostname

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please check

@longquanzheng
Copy link
Contributor

there is a flaky test issue that I just fixed. If rebase to the latest commit the pass should pass for you

@@ -683,6 +684,18 @@ func (s *serviceImpl) ApiV1WorkflowDumpPost(ctx context.Context, request iwfidl.
}, nil
}

func (s *serviceImpl) ApiInfoHealth(ctx context.Context) *iwfidl.HealthInfo {
hostName, err := os.Hostname()
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let’s swallow this error here and put a default message like host name not available. Because it’s not worth returning error here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what I did 🤔
You mean changing "Hostname Not Available" to "host name not available"?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ohh sorry i misread it on my phone

@@ -683,6 +684,18 @@ func (s *serviceImpl) ApiV1WorkflowDumpPost(ctx context.Context, request iwfidl.
}, nil
}

func (s *serviceImpl) ApiInfoHealth(ctx context.Context) *iwfidl.HealthInfo {
hostName, err := os.Hostname()
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ohh sorry i misread it on my phone

@longquanzheng longquanzheng merged commit 696223a into indeedeng:main Aug 18, 2023
3 of 4 checks passed
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.

2 participants