Skip to content

Commit

Permalink
wiresocks: reduce ipscanner timeout to 1min
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Pashmfouroush <[email protected]>
  • Loading branch information
markpash committed Aug 3, 2024
1 parent c805ea8 commit 05a019f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions wiresocks/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ type ScanOptions struct {
}

func RunScan(ctx context.Context, l *slog.Logger, opts ScanOptions) (result []ipscanner.IPInfo, err error) {
// new scanner
ctx, cancel := context.WithTimeout(ctx, 1*time.Minute)
defer cancel()

scanner := ipscanner.NewScanner(
ipscanner.WithLogger(l.With(slog.String("subsystem", "scanner"))),
ipscanner.WithWarpPing(),
Expand All @@ -31,9 +33,6 @@ func RunScan(ctx context.Context, l *slog.Logger, opts ScanOptions) (result []ip
ipscanner.WithCidrList(warp.WarpPrefixes()),
)

ctx, cancel := context.WithTimeout(ctx, 2*time.Minute)
defer cancel()

scanner.Run(ctx)

t := time.NewTicker(1 * time.Second)
Expand Down

0 comments on commit 05a019f

Please sign in to comment.