Skip to content

Commit

Permalink
fix: added wait before check process retry
Browse files Browse the repository at this point in the history
  • Loading branch information
Velka-DEV committed May 28, 2024
1 parent 93f1b37 commit 1763ad2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/core/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import (
"os"
"sync"
"sync/atomic"
"time"

"github.com/panjf2000/ants/v2"
)

type CheckerConfig struct {
Threads int
WaitBeforeRetry time.Duration
OutputToFile bool
OutputDirectory string
OutputFree bool
Expand Down Expand Up @@ -96,6 +98,7 @@ func (c *Checker) internalCheckProcess(args *CheckProcessArgs) *CheckResult {
case CheckStatusRetry:
newClient := c.clientPool.Get()
args.Client = newClient
time.Sleep(c.Config.WaitBeforeRetry)
return c.internalCheckProcess(args)
case CheckStatusFree:
atomic.AddUint64(&c.Infos.Free, 1)
Expand Down

0 comments on commit 1763ad2

Please sign in to comment.