experius / SeoSnap

Server Side Rendering (SSR) for javascript applications
GNU General Public License v3.0
52 stars 12 forks source link

Health Check endpoint for CacheServer #25

Closed bordeo closed 2 years ago

bordeo commented 3 years ago

For High Availability infrastructure cache-server need an endpoint to check if service is ready to receive requests

Something like this could be great

class Server:
    def __init__(self) -> None:
       ......
       self.add_subroute('health_check', self.health_check, methods=['GET'], prefix='/health_check')
       self.add_error_handler()

    @document_middleware
    def retrieve_cache(self, query, document) -> Response:
        """Health Check"""
        self.logger.log(logging.INFO, f'[Server] Health Check')

        return Response("health check", status=200)
lewisvoncken commented 2 years ago

Hi @bordeo

I have added a healthchecks.io example in the crontab & cachewarmer.sh & healthchecks.io. This will be available when this pr is merged https://github.com/experius/SeoSnap/pull/32

yes?

bordeo commented 2 years ago

Hi @lewisvoncken, it's not what I'm looking for. What I mean is to add an health_check (or somethingelse) path to call on CacheServer. This will be very useful for kubernetes infrastructure. It allow to setup the liveness probe

bordeo commented 2 years ago

Due to the fact that CacheServer is deprecated health check will be test against Rendertron. Rendertron has it's how "health check" api /_ah/health.

This issue is resolved.