Skip to content

Behavior of the health() method #55

@curquiza

Description

@curquiza

I notice each SDK has its own version of handling the health method.
I suggest we find the best way to handle it.

Currently, the GET /health route returns 204 without any body if MeilISearch is running. If MeiliSearch is not running, the SDK would catch another error/exception (ConnectionRefused for example) but not an error coming from the MeiliSerach API.

Option A 😁

health():

  • returns true when MeiliSearch is healthy.
  • returns false when MeiliSearch is unhealthy (an error is caught)

Option B 🎉

health():

  • returns true when MeiliSearch is healthy.
  • raises the error/exception when MeiliSearch is unhealthy. This makes the program stops.

Option C (mix of both) ♥️

health():

  • returns true when MeiliSearch is healthy.
  • raises the error/exception when MeiliSearch is unhealthy. This makes the program stops.

is_healthy():

  • returns true when MeiliSearch is healthy.
  • returns false when MeiliSearch is unhealthy (an error is caught)

📢 Let's the vote begin with the right emoji linked to each option! Of course, feel free to argue your point of view and to suggest another option!


TODO:

  • meilisearch-dart
  • meilisearch-dotnet
  • meilisearch-go
  • meilisearch-java
  • meilisearch-js
  • meilisearch-php
  • meilisearch-python
  • meilisearch-ruby
  • meilisearch-rust
  • meilisearch-swift

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions