// ForceFinishProcess terminates a process in an error state func (controller *Harvest) ForceFinishProcess() { ID := controller.Ctx.Input.Param(":id") // check if it is running intID, _ := strconv.Atoi(ID) harvestProcess := harvest.NewProcessByID(intID) harvestProcess.ForceFinish() controller.LoadTemplate("init") }
// RecoverProcess tries to recover a process func (controller *Harvest) RecoverProcess() { ID := controller.Ctx.Input.Param(":id") // check if it is running intID, _ := strconv.Atoi(ID) harvestProcess := harvest.NewProcessByID(intID) repID := harvestProcess.GetRepository().ID delete(CurrentSessions, repID) harvest.RecoverProcess(harvestProcess, controller) process := &session{ Process: harvestProcess, } CurrentSessions[repID] = process go harvestProcess.Recover() controller.LoadTemplate("init") }