Skip to content

Commit

Permalink
修正目录监听
Browse files Browse the repository at this point in the history
  • Loading branch information
fengqi committed Mar 28, 2023
1 parent 564c35b commit 57c0fe5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions music_videos/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (c *Collector) runWatcher() {
select {
case event, ok := <-c.watcher.Events:
if !ok {
return
continue
}

fileInfo, err := os.Stat(event.Name)
Expand All @@ -74,7 +74,7 @@ func (c *Collector) runWatcher() {

// 新增目录
if fileInfo.IsDir() {
videos, err := c.scanDir(fileInfo.Name())
videos, err := c.scanDir(event.Name)
if err != nil || len(videos) == 0 {
utils.Logger.WarningF("new dir %s scan err: %v", event.Name, err)
continue
Expand Down

0 comments on commit 57c0fe5

Please sign in to comment.