stats: fix docs

This commit is contained in:
Stanislav Chzhen 2023-03-03 11:42:00 +03:00
parent e0cbfc1c40
commit d5a8f24d5b
2 changed files with 4 additions and 4 deletions

View File

@ -144,7 +144,7 @@ func (s *StatsCtx) handleStatsConfig(w http.ResponseWriter, r *http.Request) {
defer s.lock.Unlock()
limit := time.Duration(reqData.IntervalDays) * timeutil.Day
s.setLimitLocked(limit)
s.setLimit(limit)
}
// handlePutStatsConfig handles requests to the PUT /control/stats/config/update

View File

@ -452,14 +452,14 @@ func (s *StatsCtx) periodicFlush() {
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.
func (s *StatsCtx) setLimitLocked(limit time.Duration) {
func (s *StatsCtx) setLimit(limit time.Duration) {
if limit != 0 {
s.enabled = true
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
}