Skip to content

Commit

Permalink
Merge pull request #24 from robgonnella/upgrade-go-lanscan-version
Browse files Browse the repository at this point in the history
Upgrade go-lanscan version
  • Loading branch information
robgonnella authored Dec 27, 2023
2 parents 3146465 + 45d1504 commit 49a9179
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/goombaio/namegenerator v0.0.0-20181006234301-989e774b106e
github.com/magiconair/properties v1.8.7
github.com/rivo/tview v0.0.0-20231206124440-5f078138442e
github.com/robgonnella/go-lanscan v1.14.1
github.com/robgonnella/go-lanscan v1.14.2
github.com/rs/zerolog v1.31.0
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.18.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ
github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/robgonnella/go-lanscan v1.14.1 h1:usqkIslJxnhgawYwLnpQwdnN+UOxzqbhHvg2pIDiYGg=
github.com/robgonnella/go-lanscan v1.14.1/go.mod h1:7Kskles7kXDGYj93jWq18o7UgIYnSONLy9Q+Ys8zN60=
github.com/robgonnella/go-lanscan v1.14.2 h1:CqGoL6DZumJ2XvECCfLOzs6J/Hin8+1RqOBjyTZgp6o=
github.com/robgonnella/go-lanscan v1.14.2/go.mod h1:7Kskles7kXDGYj93jWq18o7UgIYnSONLy9Q+Ys8zN60=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
Expand Down
6 changes: 3 additions & 3 deletions internal/discovery/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ func NewScannerService(

// MonitorNetwork polls the network to discover and track devices
func (s *ScannerService) MonitorNetwork() error {
s.log.Info().Msg("Starting network discovery")

// blocking call that continuously scans the network on an interval
return s.pollNetwork()
}
Expand Down Expand Up @@ -95,6 +93,7 @@ func (s *ScannerService) pollNetwork() error {
// start first scan
// always scan in goroutine to prevent blocking result channel
go func() {
s.log.Info().Msg("starting network scan")
if err := s.scanner.Scan(); err != nil {
s.errorChan <- err
}
Expand All @@ -105,7 +104,7 @@ func (s *ScannerService) pollNetwork() error {
for {
select {
case <-s.ctx.Done():
s.log.Info().Msg("Network polling stopped")
s.log.Info().Msg("network polling stopped")
ticker.Stop()
return s.ctx.Err()
case <-s.pauseChan:
Expand Down Expand Up @@ -153,6 +152,7 @@ func (s *ScannerService) pollNetwork() error {
case <-ticker.C:
// always scan in goroutine to prevent blocking result channel
go func() {
s.log.Info().Msg("starting network scan")
if err := s.scanner.Scan(); err != nil {
s.errorChan <- err
}
Expand Down

0 comments on commit 49a9179

Please sign in to comment.