ihippik / wal-listener

PostgreSQL WAL listener
Apache License 2.0
296 stars 44 forks source link

Add health check #35

Closed emidander closed 2 months ago

emidander commented 4 months ago

A proposal to solve https://github.com/ihippik/wal-listener/issues/31

The code does get a little more complicated, but running start up activities asynchronously is more or less a requirement for Kubernetes, as the app is expected to respond to alive-probes (but not necessarily ready-probes) at once. The general structure is one I have used in other projects, and it works well.

PR also adds optional config - the health check server is only started if the config is there.

There is perhaps some inconsistency in how log messages are formated now, but perhaps that does not matter?

ihippik commented 4 months ago

Thank you Erik! will check soon. mb just looks a little complicated..

emidander commented 4 months ago

Thank you Erik! will check soon. mb just looks a little complicated..

I know, sorry! Getting the flow right with how Kubernetes wants it is not easy to do in a simple way.