Commit 281b2373 authored by Kevin Di Lallo's avatar Kevin Di Lallo
Browse files

recycle activeModel in ctrl engine terminate/deactivate

parent 1e74e554
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -455,6 +455,15 @@ func ceTerminateScenario(w http.ResponseWriter, r *http.Request) {
		http.Error(w, err.Error(), http.StatusNotFound)
		return
	}

	// Use new model instance
	activeModel, err = mod.NewModel(mod.DbAddress, moduleName, "activeScenario")
	if err != nil {
		log.Error("Failed to create model: ", err.Error())
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}

	// Send response
	w.Header().Set("Content-Type", "application/json; charset=UTF-8")
	w.WriteHeader(http.StatusOK)
+1 −0
Original line number Diff line number Diff line
@@ -412,6 +412,7 @@ func (m *Model) GetNodeContext(name string) (ctx interface{}) {
//---Internal Funcs---

func (m *Model) parseNodes() (err error) {
	m.nodeMap = NewNodeMap()
	if m.scenario.Deployment != nil {
		if m.scenario.Deployment != nil {
			// Parse through scenario and fill external node service mappings