AdguardTeam / AdguardTeam/AdGuardHome

Use a uniform duration format in the configuration file?

Aperta
#3,034 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub
enhancement P4: Low
Lingua principale
TypeScript
Stelle
36.9k
Fork
2.5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Currently, we either have the time unit in the name of the field, like with `block_auth_min` and `dhcp.dhcpv4.icmp_timeout_msec` or don't have a unit at all, like with `dns.querylog_interval` or `web_session_ttl`. But Go has the `time.Duration` type, which has a well-known string serialisation format. Unfortunately, it doesn't implement the `encoding.TextMarshaler` and `encoding.TextUnmarshaler` interfaces, but that is relatively easy to fix. In return, we get more uniform an human-readable durations in our configuration file:

```yaml
# …
web_session_ttl: 30d
# …
dns:
# …
querylog_interval: 90d
# …
dhcp:
dhcpv4:
# …
icmp_timeout: 1s
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.