python-consul icon indicating copy to clipboard operation
python-consul copied to clipboard

Use native consul time values on Session.create

Open maximilize opened this issue 10 years ago • 1 comments

Since the consul API raises an error when the session TTL is below 10 or above 3600 seconds we don't have to do a check. The reason why this should not be done is to allow default time values like "5s", "30m" or "2h". The same with lock delay.

Note that this could break some code which is using this lib since consul assumes milliseconds per default when no other unit is given.

maximilize avatar Oct 09 '15 15:10 maximilize

Hi thanks for this. Yeah, I've been thinking through this. At the very least the lib should be consistent in how it handles time values.

So it should always be you pass an integer value that is a certain time unit, or you always pass a human friendly string value.

You're right, if we merge this patch it will break current uses of the lib (case in point, this comment breaks the tests).

cablehead avatar Oct 18 '15 15:10 cablehead