diff --git a/internal/controllers/vm.go b/internal/controllers/vm.go index 46d0814..c17541d 100644 --- a/internal/controllers/vm.go +++ b/internal/controllers/vm.go @@ -119,6 +119,8 @@ func (hv *HV) InitVMs() error { hv.Mutex.Lock() defer hv.Mutex.Unlock() + // Clear VMs + hv.VMs = nil // Load the VMs of a hypervisor into memory for i := range dbVMs { id := dbVMs[i].ID diff --git a/internal/server/routes/admin/user.go b/internal/server/routes/admin/user.go index f907ed2..e9886d9 100644 --- a/internal/server/routes/admin/user.go +++ b/internal/server/routes/admin/user.go @@ -81,7 +81,7 @@ func CreateUser(w http.ResponseWriter, r *http.Request) { func GetUsers(w http.ResponseWriter, r *http.Request) { rows, err := db.Pool.Query(context.Background(), "SELECT * FROM profile") if err != nil { - eUtil.WriteError(w, r, err, http.StatusInternalServerError, "Failed to list users") + eUtil.WriteError(w, r, err, http.StatusInternalServerError, "Failed to get users") return } defer rows.Close()