Skip to content

chore(health): allowing the checker to be called async#21

Merged
Jacobbrewer1 merged 2 commits intomainfrom
chore/checker-async
Apr 10, 2025
Merged

chore(health): allowing the checker to be called async#21
Jacobbrewer1 merged 2 commits intomainfrom
chore/checker-async

Conversation

@Jacobbrewer1
Copy link
Owner

Describe your changes

This pull request includes significant changes to the health package, primarily focusing on refactoring the Checker struct and related functionalities. The changes include converting the checker struct to Checker, updating methods and tests accordingly, and removing the MockChecker implementation.

Refactoring of Checker struct and related functionalities:

  • health/checker.go: Converted the checker struct to Checker, updated the Check method to use sync.Map for storing checks, and added the AddCheck method for adding checks to the Checker. [1] [2] [3] [4] [5]
  • health/checker_options.go: Updated CheckerOption type and related functions to work with the new Checker struct. [1] [2]

Updates to tests and documentation:

  • health/checker_test.go: Modified tests to align with the new Checker struct implementation. [1] [2]
  • health/check.go: Improved documentation for the NewCheck function to specify that each check should have a unique name.

Removal of obsolete mock implementation:

@Jacobbrewer1 Jacobbrewer1 requested a review from Copilot April 10, 2025 07:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

health/checker_options.go:7

  • [nitpick] Consider handling the error returned by AddCheck instead of discarding it. Addressing this would help catch issues like duplicate or nil checks that might otherwise go unnoticed.
return func(c *Checker) { _ = c.AddCheck(check) }

@Jacobbrewer1 Jacobbrewer1 requested a review from Copilot April 10, 2025 08:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

@Jacobbrewer1 Jacobbrewer1 merged commit 9e0c1b7 into main Apr 10, 2025
5 checks passed
@Jacobbrewer1 Jacobbrewer1 deleted the chore/checker-async branch April 10, 2025 08:18
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2025
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.

2 participants