Browse Source

Extended cluster scanning duration

TC pushbot 5 2 years ago
parent
commit
bc5cb1f191
2 changed files with 6 additions and 6 deletions
  1. 2 2
      cluster.go
  2. 4 4
      mod/network/neighbour/neighbour.go

+ 2 - 2
cluster.go

@@ -27,11 +27,11 @@ func ClusterInit() {
 		thisDiscoverer := neighbour.NewDiscoverer(MDNS, sysdb)
 		//Start a scan immediately (in go routine for non blocking)
 		go func() {
-			thisDiscoverer.UpdateScan(3)
+			thisDiscoverer.UpdateScan(10)
 		}()
 
 		//Setup the scanning timer
-		thisDiscoverer.StartScanning(300, 5)
+		thisDiscoverer.StartScanning(300, 15)
 		NeighbourDiscoverer = &thisDiscoverer
 
 		//Register the settings

+ 4 - 4
mod/network/neighbour/neighbour.go

@@ -39,7 +39,7 @@ type HostRecord struct {
 	LastOnline int64
 }
 
-//New Discoverer return a nearby Aroz Discover agent
+// New Discoverer return a nearby Aroz Discover agent
 func NewDiscoverer(MDNS *mdns.MDNSHost, Database *database.Database) Discoverer {
 	//Create a new table for neighbour records
 	Database.NewTable("neighbour")
@@ -52,7 +52,7 @@ func NewDiscoverer(MDNS *mdns.MDNSHost, Database *database.Database) Discoverer
 	}
 }
 
-//Return a list of NetworkHost with the same domain
+// Return a list of NetworkHost with the same domain
 func (d *Discoverer) GetNearbyHosts() []*mdns.NetworkHost {
 	nearbyHosts := []*mdns.NetworkHost{}
 	for _, host := range d.NearbyHosts {
@@ -62,7 +62,7 @@ func (d *Discoverer) GetNearbyHosts() []*mdns.NetworkHost {
 	return nearbyHosts
 }
 
-//Start Scanning, interval and scna Duration in seconds
+// Start Scanning, interval and scan Duration in seconds
 func (d *Discoverer) StartScanning(interval int, scanDuration int) {
 	log.Println("ArozOS Neighbour Scanning Started")
 	if d.ScannerRunning() {
@@ -152,7 +152,7 @@ func (d *Discoverer) GetOfflineHosts() ([]*HostRecord, error) {
 	return results, nil
 }
 
-//Try to wake on lan one of the network host
+// Try to wake on lan one of the network host
 func (d *Discoverer) SendWakeOnLan(macAddr string) error {
 	return wakeonlan.WakeTarget(macAddr)
 }