From 24e8dc4e9f1933b6a9b11517db7dc54996466009 Mon Sep 17 00:00:00 2001 From: lishuang Date: Sat, 11 Jul 2020 15:28:12 +0800 Subject: [PATCH] Ready to upgrade the dependencies. --- code/test/cron_test.go | 2 +- code/test/main_test.go | 5 +++-- go.mod | 1 - go.sum | 2 -- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/code/test/cron_test.go b/code/test/cron_test.go index c420cf3..dc5c665 100644 --- a/code/test/cron_test.go +++ b/code/test/cron_test.go @@ -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 { diff --git a/code/test/main_test.go b/code/test/main_test.go index e228055..dd97827 100644 --- a/code/test/main_test.go +++ b/code/test/main_test.go @@ -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() diff --git a/go.mod b/go.mod index 73d08a4..9f4697c 100644 --- a/go.mod +++ b/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 diff --git a/go.sum b/go.sum index a9007c6..e34605d 100644 --- a/go.sum +++ b/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=