stats: fix docs
This commit is contained in:
parent
e0cbfc1c40
commit
d5a8f24d5b
|
@ -144,7 +144,7 @@ func (s *StatsCtx) handleStatsConfig(w http.ResponseWriter, r *http.Request) {
|
||||||
defer s.lock.Unlock()
|
defer s.lock.Unlock()
|
||||||
|
|
||||||
limit := time.Duration(reqData.IntervalDays) * timeutil.Day
|
limit := time.Duration(reqData.IntervalDays) * timeutil.Day
|
||||||
s.setLimitLocked(limit)
|
s.setLimit(limit)
|
||||||
}
|
}
|
||||||
|
|
||||||
// handlePutStatsConfig handles requests to the PUT /control/stats/config/update
|
// handlePutStatsConfig handles requests to the PUT /control/stats/config/update
|
||||||
|
|
|
@ -452,14 +452,14 @@ func (s *StatsCtx) periodicFlush() {
|
||||||
log.Debug("periodic flushing finished")
|
log.Debug("periodic flushing finished")
|
||||||
}
|
}
|
||||||
|
|
||||||
// setLimitLocked sets the limit without locking. For internal use only.
|
// setLimit sets the limit. s.lock is expected to be locked.
|
||||||
//
|
//
|
||||||
// TODO(s.chzhen): Remove it when migration to the new API is over.
|
// TODO(s.chzhen): Remove it when migration to the new API is over.
|
||||||
func (s *StatsCtx) setLimitLocked(limit time.Duration) {
|
func (s *StatsCtx) setLimit(limit time.Duration) {
|
||||||
if limit != 0 {
|
if limit != 0 {
|
||||||
s.enabled = true
|
s.enabled = true
|
||||||
s.limit = limit
|
s.limit = limit
|
||||||
log.Debug("stats: set limit: %d days", int(limit/timeutil.Day))
|
log.Debug("stats: set limit: %d days", limit/timeutil.Day)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue