scrapinghub / scrapyrt

HTTP API for Scrapy spiders
BSD 3-Clause "New" or "Revised" License
832 stars 162 forks source link

No healthcheck endpoint #103

Open robinicole opened 4 years ago

robinicole commented 4 years ago

I need an healthcheck endpoint to deploy my scrapyrt on ecs but couldn't find any.

robinicole commented 4 years ago

Adding a healthceck ressource :

class HealthCheck(ServiceResource):

    isLeaf = True
    allowedMethods = ['GET']

    def render_GET(self, *args, **kwargs):
        return {'status': 'ok'}

would certainly solve the issue

pawelmhm commented 3 years ago

This is a matter of adding your code sample here in resources https://github.com/scrapinghub/scrapyrt/blob/master/scrapyrt/resources.py and then adding it in config https://github.com/scrapinghub/scrapyrt/blob/master/scrapyrt/conf/default_settings.py#L23

To check health it would be good to perform some command, e.g. scrapy list, to be sure project is healthy.