Matthew R Kasun 2 лет назад
Родитель
Сommit
503046a7ae
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      controllers/migrate.go

+ 4 - 3
controllers/migrate.go

@@ -90,11 +90,12 @@ func migrate(w http.ResponseWriter, r *http.Request) {
 			continue
 		}
 		host.Nodes = append(host.Nodes, node.ID.String())
-		if err := logic.UpsertHost(&host); err != nil {
-			slog.Error("save host", "error", err)
-		}
+		
 		nodes = append(nodes, node)
 	}
+	if err := logic.UpsertHost(&host); err != nil {
+		slog.Error("save host", "error", err)
+	}
 	go mq.PublishPeerUpdate()
 	response := models.HostPull{
 		Host:         host,