mirror of
https://github.com/astaxie/beego.git
synced 2025-06-12 21:50:40 +00:00
Format code
This commit is contained in:
@ -113,7 +113,7 @@ type Task struct {
|
||||
Next time.Time
|
||||
Errlist []*taskerr // like errtime:errinfo
|
||||
ErrLimit int // max length for the errlist, 0 stand for no limit
|
||||
errCnt int // records the error count during the execution
|
||||
errCnt int // records the error count during the execution
|
||||
}
|
||||
|
||||
// NewTask add new task with name, time and func
|
||||
|
@ -59,12 +59,12 @@ func TestSpec(t *testing.T) {
|
||||
func TestTask_Run(t *testing.T) {
|
||||
cnt := -1
|
||||
task := func() error {
|
||||
cnt ++
|
||||
cnt++
|
||||
fmt.Printf("Hello, world! %d \n", cnt)
|
||||
return errors.New(fmt.Sprintf("Hello, world! %d", cnt))
|
||||
}
|
||||
tk := NewTask("taska", "0/30 * * * * *", task)
|
||||
for i := 0; i < 200 ; i ++ {
|
||||
for i := 0; i < 200; i++ {
|
||||
e := tk.Run()
|
||||
assert.NotNil(t, e)
|
||||
}
|
||||
|
Reference in New Issue
Block a user