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

feat: API indexer-status endpoint #732

Merged
merged 2 commits into from
Sep 16, 2021
Merged

Conversation

khorolets
Copy link
Member

No description provided.

@render
Copy link

render bot commented Sep 10, 2021

@telezhnaya
Copy link
Contributor

Thank you! 👍

Copy link
Collaborator

@frol frol left a comment

Choose a reason for hiding this comment

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

We should return some HTTP error status code when the diff is more than 30 blocks, so we can just plug it into the services that use HTTP status codes to reason about the service health.

@khorolets
Copy link
Member Author

We should return some HTTP error status code when the diff is more than 30 blocks, so we can just plug it into the services that use HTTP status codes to reason about the service health.

I like this idea. Reference https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

I think of 5xx as it's obviously a server error, not the client. So I can suggest either 500 Internal Server Error (which is easy to connect with third-party service) or 503 as we can consider that Service is unavailable.

So I can propose to return the data I'm returning currently + status 200 if the diff is between 30 blocks and 500/503 if diff is more than 30. WDYT @frol @telezhnaya ?

@frol
Copy link
Collaborator

frol commented Sep 12, 2021

HTTP 503 sounds the most appropriate here

@khorolets khorolets force-pushed the feat/api-indexer-status-endpoint branch from 9631412 to 1cc1461 Compare September 13, 2021 13:51
@khorolets khorolets requested a review from frol September 13, 2021 14:42
@frol
Copy link
Collaborator

frol commented Sep 14, 2021

I will merge it later today batched with some other PRs.

@frol frol merged commit 57bd73c into master Sep 16, 2021
@frol frol deleted the feat/api-indexer-status-endpoint branch September 16, 2021 08:24
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.

3 participants