Beispiel #1
0
// 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")
}
Beispiel #2
0
// 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")
}