python-discord / pixels

Pixels is an introductory API from Python Discord for painting on a collaborative canvas.
https://pixels.pythondiscord.com/
MIT License
32 stars 8 forks source link

Aliveness check endpoint #117

Open ChrisLovering opened 3 years ago

ChrisLovering commented 3 years ago

Implement a /ping endpoint (or similar) so that we can check when the system is ready to serve requests.

This should only return a 2XX code once all caches are up to date.

vcokltfre commented 3 years ago

Can I implement this one :P

ChrisLovering commented 3 years ago

As part of this, we should also move GET /size back into the general router, so it requires auth

ChrisLovering commented 3 years ago

Can I implement this one :P

Yes :) But I suggest waiting until #106 is merged :P

Akarys42 commented 3 years ago

Bikeshed: /healthcheck is a better name for the route :P

ChrisLovering commented 3 years ago

Maybe two endpoints? An aliveness check which returns as soon as it's serving, and then a readiness check, which is when the caches are ready.

This will line up with the checks we can configure in k8s

ChrisLovering commented 3 years ago

On second thought, and some discussion in #dev-pixels having one health check endpoint should be enough.

As long as it returns when the caches are ready, we can use that for a liveness and readiness check.