mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2025-08-18 00:49:47 +02:00
Ability to specify aliases
Ability to specify aliases that automatically append to /etc/hosts
This commit is contained in:
@@ -48,14 +48,7 @@ func (s *SyncerImpl) Sync(meshId string) error {
|
||||
return errors.New("the provided mesh does not exist")
|
||||
}
|
||||
|
||||
snapshot, err := theMesh.GetMesh()
|
||||
|
||||
s.manager.GetMonitor().Trigger(meshId, snapshot)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
snapshot, _ := theMesh.GetMesh()
|
||||
nodes := snapshot.GetNodes()
|
||||
|
||||
if len(nodes) <= 1 {
|
||||
@@ -109,24 +102,19 @@ func (s *SyncerImpl) Sync(meshId string) error {
|
||||
waitGroup.Wait()
|
||||
|
||||
s.syncCount++
|
||||
logging.Log.WriteInfof("SYNC TIME: %v", time.Now().Sub(before))
|
||||
logging.Log.WriteInfof("SYNC TIME: %v", time.Since(before))
|
||||
logging.Log.WriteInfof("SYNC COUNT: %d", s.syncCount)
|
||||
|
||||
s.infectionCount = ((s.conf.InfectionCount + s.infectionCount - 1) % s.conf.InfectionCount)
|
||||
|
||||
newMesh := s.manager.GetMesh(meshId)
|
||||
snapshot, err = newMesh.GetMesh()
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
// Check if any changes have occurred and trigger callbacks
|
||||
// if changes have occurred.
|
||||
return s.manager.GetMonitor().Trigger()
|
||||
}
|
||||
|
||||
// SyncMeshes: Sync all meshes
|
||||
func (s *SyncerImpl) SyncMeshes() error {
|
||||
for meshId, _ := range s.manager.GetMeshes() {
|
||||
for meshId := range s.manager.GetMeshes() {
|
||||
err := s.Sync(meshId)
|
||||
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user