Ready to upgrade the dependencies.
This commit is contained in:
parent
dbeef1cee4
commit
24e8dc4e9f
@ -8,7 +8,7 @@ import (
|
||||
func TestValidateCron(t *testing.T) {
|
||||
|
||||
spec := "*/1 * * * * ?"
|
||||
_, err := cron.Parse(spec)
|
||||
_, err := cron.ParseStandard(spec)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
} else {
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"github.com/eyebluecn/tank/code/core"
|
||||
"github.com/eyebluecn/tank/code/tool/util"
|
||||
"github.com/robfig/cron"
|
||||
"github.com/robfig/cron/v3"
|
||||
"log"
|
||||
"strings"
|
||||
"testing"
|
||||
@ -28,13 +28,14 @@ func TestCron(t *testing.T) {
|
||||
i := 0
|
||||
c := cron.New()
|
||||
spec := "*/1 * * * * ?"
|
||||
err := c.AddFunc(spec, func() {
|
||||
entryId, err := c.AddFunc(spec, func() {
|
||||
i++
|
||||
log.Println("cron running:", i)
|
||||
if i == 3 {
|
||||
panic("intent to panic.")
|
||||
}
|
||||
})
|
||||
fmt.Printf("entryId = %d", entryId)
|
||||
core.PanicError(err)
|
||||
|
||||
c.Start()
|
||||
|
1
go.mod
1
go.mod
@ -10,7 +10,6 @@ require (
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.1 // indirect
|
||||
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d
|
||||
github.com/robfig/cron v1.2.0 // indirect
|
||||
github.com/robfig/cron/v3 v3.0.1
|
||||
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073
|
||||
golang.org/x/image v0.0.0-20200119044424-58c23975cae1 // indirect
|
||||
|
2
go.sum
2
go.sum
@ -37,8 +37,6 @@ github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/
|
||||
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=
|
||||
github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
|
||||
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
|
||||
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
|
Loading…
Reference in New Issue
Block a user