poppyred / python-consul2

Python client for the Consul HTTP API ,Continue develop on cablehead/python-consul
https://python-consul2.readthedocs.io/
MIT License
130 stars 28 forks source link

Add consistency support to Health endpoints #35

Open ciscopony opened 3 years ago

ciscopony commented 3 years ago

This is a "To-Do" in the current code, I've tested adding:

def ENDPOINT(self, ... consistency=None): ... consistency = consistency or self.agent.consistency if consistency in ('consistent', 'stale'): params.append((consistency, '1'))
...

To the ENDPOINT=service/checks/state/node blocks and it appears to work, I'd be happy to submit a PR. Having this functionality would help with a performance issue we hit occasionally during cluster leadership changes.