Skip to content

Commit

Permalink
Reduce scan interval in cleanupDeletedFiles
Browse files Browse the repository at this point in the history
Signed-off-by: Changxin Miao <[email protected]>
  • Loading branch information
polyrabbit committed Dec 4, 2024
1 parent 450d0de commit 1ca9d91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/meta/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,8 @@ func (m *baseMeta) Init(format *Format, force bool) error {

func (m *baseMeta) cleanupDeletedFiles() {
for {
utils.SleepWithJitter(time.Minute)
if ok, err := m.en.setIfSmall("lastCleanupFiles", time.Now().Unix(), int64(time.Minute.Seconds())*9/10); err != nil {
utils.SleepWithJitter(time.Hour)
if ok, err := m.en.setIfSmall("lastCleanupFiles", time.Now().Unix(), int64(time.Hour.Seconds())*9/10); err != nil {
logger.Warnf("checking counter lastCleanupFiles: %s", err)
} else if ok {
files, err := m.en.doFindDeletedFiles(time.Now().Add(-time.Hour).Unix(), 10000)
Expand Down

0 comments on commit 1ca9d91

Please sign in to comment.