change flag name to usage-interval

This commit is contained in:
Samir Patel 2021-05-26 10:38:19 -05:00 • committed by Samir Patel
parent 42067237f7
commit ae6687e71b
3 changed files with 6 additions and 6 deletions

View file

@ -111,6 +111,6 @@ func BuildServerFlags(cmd *cobra.Command, srv *server.Command) {
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.DurationVar((*time.Duration)(&srv.Config.DiskUsage.Interval), "disk-usage-interval", time.Duration(srv.Config.DiskUsage.Interval), "Number in minutes between recalculations of disk usage cache")
// Disk/Memory Usage refresh rate in minutes for ui/usage http endpoint
flags.DurationVar((*time.Duration)(&srv.Config.Usage.Interval), "usage-interval", time.Duration(srv.Config.Usage.Interval), "Number in minutes between recalculations of disk/memory usage cache")
}

View file

@ -226,8 +226,8 @@ type Config struct {
LookupDBDSN string `toml:"lookup-db-dsn"`
// Disk Usage refresh interval for ui/usage http endpoint
DiskUsage struct {
Interval toml.Duration `toml:"disk-usage-interval"`
Usage struct {
Interval toml.Duration `toml:"usage-interval"`
}
}
@ -364,7 +364,7 @@ func NewConfig() *Config {
c.Etcd.PeerCertFile = ""
c.Etcd.PeerKeyFile = ""
c.DiskUsage.Interval = toml.Duration(6 * 60 * time.Minute) // 6 hours
c.Usage.Interval = toml.Duration(6 * 60 * time.Minute) // 6 hours
return c
}

View file

@ -277,7 +277,7 @@ func (m *Command) Start() (err error) {
}
}
go m.API.RefreshUsageCache(time.Duration(m.Config.DiskUsage.Interval))
go m.API.RefreshUsageCache(time.Duration(m.Config.Usage.Interval))
_ = testhook.Opened(pilosa.NewAuditor(), m, nil)
close(m.Started)