Ability to specify aliases

Ability to specify aliases that automatically append to /etc/hosts
This commit is contained in:
Tim Beatham
2023-11-17 22:13:51 +00:00
parent f6160fe138
commit 68db795f47
17 changed files with 421 additions and 99 deletions

View File

@@ -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 {