5 ms·
> Don’t design your config file like this: > request_timeout = 10 > Accept one of these instead: > request_timeout = 10s > request_timeout_seconds = 10 Wha
by teddyh 5y ago
> Don’t design your config file like this:
> request_timeout = 10
> Accept one of these instead:
> request_timeout = 10s
> request_timeout_seconds = 10
What does ”s” imply? Can I write “10m” for 10 minutes, or is that 10 months? Non-standardized syntax is dangerous.
For config files, I use RFC 3339 duration syntax; i.e. “PT5M” for five minutes. It was the most standardized syntax for semi-human readable time periods which I could find.
- pikzel 5y agoHad I seen PT5M I would have never guessed it meant five minutes, so you would need to refer to the RFC then.
- hkolk 5y ago`m` is not a legal value, should be either `min` or `mo` for minutes or months respectively. `s` is actually one of the SI base units: https://en.wikipedia.org/wiki/International_System_of_Units#SI_base_units https://en.wikipedia.org/wiki/International_System_of_Units#... edit: actually, month should never be used for the case described anyway... 28-31 days?
- teddyh 5y agoIf the syntax isn’t obvious without looking at the manual, you might as well use an actual standardized syntax. For months (without context, and where you need an absolute interval), I just interpret it as 4 weeks.
- int_19h 5y agoIf the syntax isn't obvious, you should use however much verbosity it takes to make it obvious, because people will still ignore the standard and make mistakes.
- tremon 5y agoI just interpret it as 4 weeks Funny, I would interpret a month as 30 days (since the lunar cycle is slightly over 29.5 days).