aeternity / aeternal

Æterrnal--the caching and reporting layer for the æternity blockchain
https://aeternal.io
ISC License
18 stars 10 forks source link

Make `status` endpoint to don't return 503 error code #254

Open davidyuk opened 4 years ago

davidyuk commented 4 years ago
$ curl -D - https://mainnet.aeternal.io/middleware/status
HTTP/1.1 503 Service Unavailable
Date: Mon, 30 Dec 2019 06:56:34 GMT
Server: Rocket
content-type: application/json
Content-Length: 110
Access-Control-Allow-Origin: *
Connection: close

{"OK":false,"errors_last_500_blocks":0,"queue_length":47,"seconds_since_last_block":144304,"version":"0.13.0"}

Returning of the 503 error with the correct response looks confusing. We are using axios to get status, and it fails with an exception, but in this case, we can handle the response as usual. I think the status endpoint should return error code only if it can't return the response with the usual structure.

johnsnewby commented 4 years ago

We rely on this behaviour.

davidyuk commented 4 years ago

Can you elaborate?