Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CnChunfeng
/
crm_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9193d1fd
authored
Sep 03, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整任务监听脚本
parent
ce5650ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
cmd/task/task_monitor/main.go
cmd/task/task_monitor/main.go
View file @
9193d1fd
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment