start and end log message
parent
75f4d5ef99
commit
686df6975a
3
main.go
3
main.go
|
@ -39,6 +39,9 @@ COLORIZED_OUTPUT=true
|
||||||
HOST=127.0.0.1
|
HOST=127.0.0.1
|
||||||
PORT=8080
|
PORT=8080
|
||||||
|
|
||||||
|
LOG_MANAGER_SERVER_URL=http://localhost:50110
|
||||||
|
SSE_SERVER_ENABLED=true
|
||||||
|
|
||||||
# MariaDB
|
# MariaDB
|
||||||
MARIADB_HOSTNAME=127.0.0.1
|
MARIADB_HOSTNAME=127.0.0.1
|
||||||
MARIADB_PORT=3306
|
MARIADB_PORT=3306
|
||||||
|
|
|
@ -183,6 +183,10 @@ func UpdateRobotCurrentJob(r *structs.Robot, jobId string, jobName string) {
|
||||||
return
|
return
|
||||||
} */
|
} */
|
||||||
|
|
||||||
|
if r.CurrentJobId != jobId && jobId != "" {
|
||||||
|
logger.AddRobotLog(rslogger.LogTypeInfo, utils.RobotTypeRex, r.Id, "------ Start job id: %v name: %v ------", jobId, jobName)
|
||||||
|
}
|
||||||
|
|
||||||
r.CurrentJobId = jobId
|
r.CurrentJobId = jobId
|
||||||
r.CurrentJobName = jobName
|
r.CurrentJobName = jobName
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ import (
|
||||||
"git.ex.umbach.dev/Alex/roese-utils/rslogger"
|
"git.ex.umbach.dev/Alex/roese-utils/rslogger"
|
||||||
"git.ex.umbach.dev/Alex/roese-utils/rsutils"
|
"git.ex.umbach.dev/Alex/roese-utils/rsutils"
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ControlRex(c *fiber.Ctx) error {
|
func ControlRex(c *fiber.Ctx) error {
|
||||||
|
@ -114,11 +115,15 @@ func FinishControlRex(c *fiber.Ctx) error {
|
||||||
return c.SendStatus(fiber.StatusUnprocessableEntity)
|
return c.SendStatus(fiber.StatusUnprocessableEntity)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastJobName := r.CurrentJobName
|
||||||
|
|
||||||
robot.UpdateRobotCurrentJob(r, "", "")
|
robot.UpdateRobotCurrentJob(r, "", "")
|
||||||
robot.CountDownJobsWaiting(r)
|
robot.CountDownJobsWaiting(r)
|
||||||
robot.UpdateRobotStatus(r, utils.RobotStatusIdle)
|
robot.UpdateRobotStatus(r, utils.RobotStatusIdle)
|
||||||
|
|
||||||
logger.AddRobotLog(rslogger.LogTypeInfo, utils.RobotTypeRex, r.Id, "Finish control robot")
|
log.Info().Msgf("finish %v %v", body, r)
|
||||||
|
|
||||||
|
logger.AddRobotLog(rslogger.LogTypeInfo, utils.RobotTypeRex, r.Id, "------ Finished job id: %s name: %s ------", body.JobId, lastJobName)
|
||||||
|
|
||||||
return c.SendStatus(fiber.StatusOK)
|
return c.SendStatus(fiber.StatusOK)
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ def randomId():
|
||||||
# 10 random rexrobot
|
# 10 random rexrobot
|
||||||
|
|
||||||
RexRobot("test")
|
RexRobot("test")
|
||||||
RexRobot("759")
|
#RexRobot("759")
|
||||||
'''
|
'''
|
||||||
for i in range(1):
|
for i in range(1):
|
||||||
#RexRobot(str(randomId()))
|
#RexRobot(str(randomId()))
|
||||||
|
@ -57,8 +57,7 @@ def hello():
|
||||||
|
|
||||||
print("controlling robot", body)
|
print("controlling robot", body)
|
||||||
|
|
||||||
time.sleep(3)
|
time.sleep(1)
|
||||||
|
|
||||||
|
|
||||||
print("robot controlled")
|
print("robot controlled")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue