processing

main
alex 2023-10-18 23:11:35 +02:00
parent 59b90f5c88
commit 75f4d5ef99
2 changed files with 5 additions and 6 deletions

View File

@ -96,8 +96,8 @@ func RobotFreeUpJobHandler() {
continue continue
} }
logger.AddSystemLog(rslogger.LogTypeError, "Robot %s job with id %s and name %s freed up because it was not correctly finished", robot.Name, robot.CurrentJobId, robot.CurrentJobName) logger.AddSystemLog(rslogger.LogTypeError, "Robot %s job with id %s and name %s freed up after %v because it was not correctly finished", robot.Name, robot.CurrentJobId, robot.CurrentJobName, utils.RobotFreeUpJobInterval)
logger.AddRobotLog(rslogger.LogTypeError, robot.Type, robot.Id, "Job with id %s and name %s freed up because it was not correctly finished", robot.CurrentJobId, robot.CurrentJobName) logger.AddRobotLog(rslogger.LogTypeError, robot.Type, robot.Id, "Job with id %s and name %s freed up after %v because it was not correctly finished", robot.CurrentJobId, robot.CurrentJobName, utils.RobotFreeUpJobInterval)
FreeUpJob(robot, utils.RobotStatusError) FreeUpJob(robot, utils.RobotStatusError)
} }
@ -156,11 +156,9 @@ func ProcessJobTask(r *structs.Robot, jobId string, jobName string) {
CountUpJobsWaiting(r, jobId, jobName) CountUpJobsWaiting(r, jobId, jobName)
} }
for r.CurrentJobId != "" &&
r.CurrentJobId != jobId &&
r.Status != utils.RobotStatusWaiting &&
r.Status != utils.RobotStatusError {
// wait for current job to finish // wait for current job to finish
for r.CurrentJobId != "" &&
r.CurrentJobId != jobId {
if r.Status == utils.RobotStatusOffline { if r.Status == utils.RobotStatusOffline {
logger.AddRobotLog(rslogger.LogTypeError, r.Type, r.Id, "Job with id %s and name %s canceled", jobId, jobName) logger.AddRobotLog(rslogger.LogTypeError, r.Type, r.Id, "Job with id %s and name %s canceled", jobId, jobName)
return return

View File

@ -116,6 +116,7 @@ func FinishControlRex(c *fiber.Ctx) error {
robot.UpdateRobotCurrentJob(r, "", "") robot.UpdateRobotCurrentJob(r, "", "")
robot.CountDownJobsWaiting(r) robot.CountDownJobsWaiting(r)
robot.UpdateRobotStatus(r, utils.RobotStatusIdle)
logger.AddRobotLog(rslogger.LogTypeInfo, utils.RobotTypeRex, r.Id, "Finish control robot") logger.AddRobotLog(rslogger.LogTypeInfo, utils.RobotTypeRex, r.Id, "Finish control robot")