Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Commit

Permalink
depth 기능 config에 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
심승용 committed May 17, 2020
1 parent 81d99cf commit 44b62d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions beater/lsbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Lsbeat struct {
client beat.Client
period time.Duration
paths []string
smbDrives []string
depth int
lastIndexTime time.Time // 가장 마지막 검색한 시간
}

Expand All @@ -38,7 +38,7 @@ func New(b *beat.Beat, cfg *common.Config) (beat.Beater, error) {
}

bt.paths = c.Paths
bt.smbDrives = c.SmbDrives
bt.depth = c.Depth

return bt, nil
}
Expand All @@ -61,7 +61,7 @@ func (bt *Lsbeat) Run(b *beat.Beat) error {
continue
}
path = s.Replace(path, "\\", "/", -1)
listDir(path, bt, b, 1)
listDir(path, bt, b, bt.depth)
}

select {
Expand Down
6 changes: 3 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
)

type Config struct {
Period time.Duration `config:"period"`
Paths []string `config:"paths"`
SmbDrives []string `config:"smb_drives"`
Period time.Duration `config:"period"`
Paths []string `config:"paths"`
Depth int `config:"depth"`
}

var (
Expand Down

0 comments on commit 44b62d0

Please sign in to comment.