add server flag

This commit is contained in:
Samir Patel 2021-05-24 23:21:40 -05:00 • committed by Samir Patel
parent be10927ca7
commit 835c63011a
2 changed files with 6 additions and 0 deletions

View file

@ -110,4 +110,7 @@ func BuildServerFlags(cmd *cobra.Command, srv *server.Command) {
flags.DurationVar((*time.Duration)(&srv.Config.Postgres.WriteTimeout), "postgres.write-timeout", time.Duration(srv.Config.Postgres.WriteTimeout), "Timeout for writes on a postgres connection. (set 0 to disable)")
flags.Uint32Var(&srv.Config.Postgres.MaxStartupSize, "postgres.max-startup-size", srv.Config.Postgres.MaxStartupSize, "Maximum acceptable size of a postgres startup packet, in bytes. (set 0 to disable)")
flags.Uint16Var(&srv.Config.Postgres.ConnectionLimit, "postgres.connection-limit", srv.Config.Postgres.ConnectionLimit, "Maximum number of simultaneous postgres connections to allow. (set 0 to disable)")
// Disk Usage refresh rate in minutes for ui/usage http endpoint
flags.IntVar(&srv.Config.DiskUsageRefreshRate, "disk-usage-refresh-rate", srv.Config.DiskUsageRefreshRate, "Number in minutes between recalculations of disk usage cache")
}

View file

@ -224,6 +224,9 @@ type Config struct {
// LookupDBDSN is an external database to connect to for `ExternalLookup` queries.
LookupDBDSN string `toml:"lookup-db-dsn"`
// Disk Usage refresh rate in minutes for ui/usage http endpoint
DiskUsageRefreshRate int `toml:"disk-ussage-refresh-rate"`
}
// MustValidate checks that all ports in a Config are unique and not zero.