Skip to content

Commit

Permalink
feat: sleeper fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincobain2000 committed Jan 20, 2025
1 parent 56e66c7 commit 9dc6cc7
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"log/slog"
"os"
"sync"
"time"

"github.com/jasonlvhit/gocron"
"github.com/patrickmn/go-cache"
Expand All @@ -23,8 +22,6 @@ var filePathsMutex sync.Mutex
var cacheMutex sync.Mutex
var caches = make(map[string]*cache.Cache)

const SafeSleepSeconds = 5

func main() {
pkg.Parseflags(&f)
pkg.SetupLoggingStdout(f) // nolint: errcheck
Expand Down Expand Up @@ -96,10 +93,6 @@ func cronWatch() {

for _, filePath := range filePaths {
watch(filePath)
if f.Every >= SafeSleepSeconds*2 {
slog.Info("Sleeping before watching next file", "seconds", 5)
time.Sleep(SafeSleepSeconds * time.Second)
}
}
}

Expand Down

0 comments on commit 9dc6cc7

Please sign in to comment.