Skip to content

Commit

Permalink
Merge pull request #148 from carlosrodfern/master
Browse files Browse the repository at this point in the history
fix no unlock upon error
  • Loading branch information
SuperQ committed Apr 2, 2024
2 parents 66bd227 + 8bf8ae1 commit 8cd0a9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ func (s *smokePingers) prepare(hosts *[]string, interval *time.Duration, privile

maxInterval := *interval
sc.Lock()
defer sc.Unlock()
for _, targetGroup := range sc.C.Targets {
packetSize := targetGroup.Size
if packetSize < 24 || packetSize > 65535 {
Expand All @@ -178,7 +179,6 @@ func (s *smokePingers) prepare(hosts *[]string, interval *time.Duration, privile
pingers = append(pingers, pinger)
}
}
sc.Unlock()
s.prepared = pingers
s.maxInterval = maxInterval
return nil
Expand Down

0 comments on commit 8cd0a9e

Please sign in to comment.