Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
4d8e1f93
Commit
4d8e1f93
authored
Apr 29, 2016
by
astaxie
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1909 from albertma/master
Start timer task Multiple times
parents
73f49994
e607be6f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
task.go
toolbox/task.go
+9
-2
No files found.
toolbox/task.go
View file @
4d8e1f93
...
@@ -389,6 +389,10 @@ func dayMatches(s *Schedule, t time.Time) bool {
...
@@ -389,6 +389,10 @@ func dayMatches(s *Schedule, t time.Time) bool {
// StartTask start all tasks
// StartTask start all tasks
func
StartTask
()
{
func
StartTask
()
{
if
isstart
{
//If already started, no need to start another goroutine.
return
}
isstart
=
true
isstart
=
true
go
run
()
go
run
()
}
}
...
@@ -432,8 +436,11 @@ func run() {
...
@@ -432,8 +436,11 @@ func run() {
// StopTask stop all tasks
// StopTask stop all tasks
func
StopTask
()
{
func
StopTask
()
{
isstart
=
false
if
isstart
{
stop
<-
true
isstart
=
false
stop
<-
true
}
}
}
// AddTask add task with name
// AddTask add task with name
...
...
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