Commit 9193d1fd by 朱继来

调整任务监听脚本

parent ce5650ad
Showing with 4 additions and 3 deletions
......@@ -46,7 +46,8 @@ func main() {
logger.Init()
// 定时执行
ticker := time.NewTicker(time.Second * 5)
ticker := time.NewTicker(time.Minute * 5)
//ticker := time.NewTicker(time.Second * 5)
for {
select {
......@@ -60,7 +61,7 @@ func main() {
}
func updateOverTime() {
row, err := dao.GetDb().Queryx("select * from lie_task_info where status = 1")
row, err := dao.GetDb().Queryx("select * from lie_task_info where status = 1 limit 100")
if err != nil {
logger.Info("获取待处理的任务记录失败: ", err.Error())
......@@ -130,7 +131,7 @@ func updateOverTime() {
}
// 标记已超时状态
dao.GetDb().Exec("update lie_task_info set status = ? where id = ?", -1, task_info.Id)
dao.GetDb().Exec("update lie_task_info set status = ?, update_time = ? where id = ?", -1, task_info.Id, current_time)
}
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment