This commit is contained in:
crusader 2018-04-20 00:25:07 +09:00
parent 0720771a87
commit aca4ca25c6
3 changed files with 1 additions and 10 deletions

View File

@ -4,8 +4,6 @@ import (
"sync"
"time"
"git.loafle.net/commons/logging-go"
"git.loafle.net/commons/util-go/net/cidr"
ocdm "git.loafle.net/overflow/commons-go/discovery/model"
)
@ -152,7 +150,6 @@ func (d *defaultDiscoverer) innerDiscoverZone(wg *sync.WaitGroup, dataChan chan
},
func(result interface{}) {
z := result.(*ocdm.Zone)
logging.Logger().Debugf("zone discovered: %v", z)
dataChan <- retainDiscoveryData(DiscoveryDataTypeZone, time.Now(), z, nil)
if nil != dz.DiscoveryHost {
cr, _ := cidr.NewCIDRRanger(z.Network)
@ -182,7 +179,6 @@ func (d *defaultDiscoverer) innerDiscoverHost(wg *sync.WaitGroup, dataChan chan
},
func(result interface{}) {
h := result.(*ocdm.Host)
logging.Logger().Debugf("host discovered: %v", h)
dataChan <- retainDiscoveryData(DiscoveryDataTypeHost, time.Now(), h, nil)
if nil != dh.DiscoveryPort {
wg.Add(1)
@ -206,7 +202,6 @@ func (d *defaultDiscoverer) innerDiscoverPort(wg *sync.WaitGroup, dataChan chan
},
func(result interface{}) {
p := result.(*ocdm.Port)
logging.Logger().Debugf("port discovered: %v", p)
dataChan <- retainDiscoveryData(DiscoveryDataTypePort, time.Now(), p, nil)
if nil != dp.DiscoveryService {
wg.Add(1)
@ -230,7 +225,6 @@ func (d *defaultDiscoverer) innerDiscoverSerice(wg *sync.WaitGroup, dataChan cha
},
func(result interface{}) {
s := result.(*ocdm.Service)
logging.Logger().Debugf("service discovered: %v", s)
dataChan <- retainDiscoveryData(DiscoveryDataTypeService, time.Now(), s, nil)
},
func(err error) {

View File

@ -48,7 +48,7 @@ func ScanHost(zone *ocdm.Zone, dh *ocdm.DiscoveryHost, resultChan chan interface
select {
case packet, ok := <-arpChan:
if !ok {
logging.Logger().Debugf("Discovery: arp channel is closed")
logging.Logger().Debugf("arp channel is closed")
return
}
if h := handlePacketARP(zone, hostRanges, hosts, packet); nil != h {

View File

@ -7,7 +7,6 @@ import (
cda "git.loafle.net/commons/di-go/annotation"
cdr "git.loafle.net/commons/di-go/registry"
"git.loafle.net/commons/logging-go"
ocdm "git.loafle.net/overflow/commons-go/discovery/model"
ocs "git.loafle.net/overflow/container-go/service"
"git.loafle.net/overflow/container_discovery/internal/discoverer"
@ -127,10 +126,8 @@ func (s *DiscoveryService) handleDiscovery(requesterID string, discoveryFunc fun
}
switch data.Type {
case discoverer.DiscoveryDataTypeStart:
logging.Logger().Debugf("DiscoveryService.DiscoveryStart: %s", data.Time.String())
s.ProbeService.Send("DiscoveryService.DiscoveryStart", requesterID, data.Time)
case discoverer.DiscoveryDataTypeStop:
logging.Logger().Debugf("DiscoveryService.DiscoveryStop: %s", data.Time.String())
s.ProbeService.Send("DiscoveryService.DiscoveryStop", requesterID, data.Time)
data.Release()
return nil