alphagov/govuk_crawler_worker — pull request #13 by KushalP (2014-07-04 12:58:17+00:00)
Title: [#73135254] HTTP health check

Added a `HealthCheck` object that is passed a reference to the `queue.QueueManager` and `ttl_hash_set.TTLHashSet` objects we're instantiating. It then provides a single method for checking the status of these services: `Status()`.

The object also provides an HTTP handler that is wired into Go's HTTP server in the `main` function of our worker.

You can test this functionality out by running the tests (currently passing on Travis-CI) or locally and view the output as follows:

- Start Redis
- Start RabbitMQ
- Run `go build`
- Start the worker binary
- Run `curl http://localhost:8080` (assuming default worker config)
- Stop Redis
- Run `curl http://localhost:8080`
- Spot the difference in the status response