diff --git a/dcron_test.go b/dcron_test.go index dace3b7..1707bfb 100644 --- a/dcron_test.go +++ b/dcron_test.go @@ -8,10 +8,10 @@ import ( "testing" "time" - "github.com/go-redis/redis/v8" "github.com/libi/dcron" "github.com/libi/dcron/dlog" "github.com/libi/dcron/driver" + "github.com/redis/go-redis/v9" "github.com/robfig/cron/v3" "github.com/stretchr/testify/require" ) diff --git a/driver/driver.go b/driver/driver.go index a01c1aa..3a70a04 100644 --- a/driver/driver.go +++ b/driver/driver.go @@ -3,7 +3,7 @@ package driver import ( "context" - "github.com/go-redis/redis/v8" + "github.com/redis/go-redis/v9" clientv3 "go.etcd.io/etcd/client/v3" ) diff --git a/driver/redisdriver.go b/driver/redisdriver.go index 6ad371b..d618971 100644 --- a/driver/redisdriver.go +++ b/driver/redisdriver.go @@ -8,8 +8,8 @@ import ( "sync" "time" - "github.com/go-redis/redis/v8" "github.com/libi/dcron/dlog" + "github.com/redis/go-redis/v9" ) const ( @@ -114,7 +114,7 @@ func (rd *RedisDriver) heartBeat() { } func (rd *RedisDriver) registerServiceNode() error { - return rd.c.SetEX(context.Background(), rd.nodeID, rd.nodeID, rd.timeout).Err() + return rd.c.SetEx(context.Background(), rd.nodeID, rd.nodeID, rd.timeout).Err() } func (rd *RedisDriver) scan(ctx context.Context, matchStr string) ([]string, error) { diff --git a/driver/redisdriver_test.go b/driver/redisdriver_test.go index 2761f0b..4cf380f 100644 --- a/driver/redisdriver_test.go +++ b/driver/redisdriver_test.go @@ -7,9 +7,9 @@ import ( "time" "github.com/alicebob/miniredis/v2" - "github.com/go-redis/redis/v8" "github.com/libi/dcron/dlog" "github.com/libi/dcron/driver" + "github.com/redis/go-redis/v9" "github.com/stretchr/testify/require" ) diff --git a/driver/rediszsetdriver.go b/driver/rediszsetdriver.go index 968e695..a1372ed 100644 --- a/driver/rediszsetdriver.go +++ b/driver/rediszsetdriver.go @@ -8,8 +8,8 @@ import ( "sync" "time" - "github.com/go-redis/redis/v8" "github.com/libi/dcron/dlog" + "github.com/redis/go-redis/v9" ) type RedisZSetDriver struct { @@ -133,7 +133,7 @@ func (rd *RedisZSetDriver) heartBeat() { } func (rd *RedisZSetDriver) registerServiceNode() error { - return rd.c.ZAdd(context.Background(), GetKeyPre(rd.serviceName), &redis.Z{ + return rd.c.ZAdd(context.Background(), GetKeyPre(rd.serviceName), redis.Z{ Score: float64(time.Now().Unix()), Member: rd.nodeID, }).Err() diff --git a/driver/rediszsetdriver_test.go b/driver/rediszsetdriver_test.go index 12c8079..4302093 100644 --- a/driver/rediszsetdriver_test.go +++ b/driver/rediszsetdriver_test.go @@ -6,9 +6,9 @@ import ( "time" "github.com/alicebob/miniredis/v2" - "github.com/go-redis/redis/v8" "github.com/libi/dcron/dlog" "github.com/libi/dcron/driver" + "github.com/redis/go-redis/v9" "github.com/stretchr/testify/require" ) diff --git a/examples/example/example.go b/examples/example/example.go index f7a8af3..6764026 100644 --- a/examples/example/example.go +++ b/examples/example/example.go @@ -8,11 +8,11 @@ import ( "strconv" "time" - "github.com/go-redis/redis/v8" "github.com/google/uuid" "github.com/libi/dcron" "github.com/libi/dcron/dlog" "github.com/libi/dcron/driver" + "github.com/redis/go-redis/v9" ) const ( diff --git a/examples/stablejob/stablejob.go b/examples/stablejob/stablejob.go index d13f916..1fc4ae8 100644 --- a/examples/stablejob/stablejob.go +++ b/examples/stablejob/stablejob.go @@ -6,11 +6,11 @@ import ( "os" "time" - "github.com/go-redis/redis/v8" "github.com/libi/dcron" "github.com/libi/dcron/dlog" "github.com/libi/dcron/driver" examplesCommon "github.com/libi/dcron/examples/common" + "github.com/redis/go-redis/v9" ) type EnvConfig struct { diff --git a/examples/tools/tools.go b/examples/tools/tools.go index 31b6a32..5078f0e 100644 --- a/examples/tools/tools.go +++ b/examples/tools/tools.go @@ -4,8 +4,8 @@ import ( "context" "flag" - "github.com/go-redis/redis/v8" examplesCommon "github.com/libi/dcron/examples/common" + "github.com/redis/go-redis/v9" ) var ( diff --git a/go.mod b/go.mod index a594f31..c791864 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,8 @@ go 1.19 require ( github.com/alicebob/miniredis/v2 v2.31.0 - github.com/go-redis/redis/v8 v8.11.5 github.com/google/uuid v1.4.0 + github.com/redis/go-redis/v9 v9.3.1 github.com/robfig/cron/v3 v3.0.1 github.com/stretchr/testify v1.8.4 go.etcd.io/etcd/api/v3 v3.5.11 diff --git a/go.sum b/go.sum index b477b25..a7fae8b 100644 --- a/go.sum +++ b/go.sum @@ -14,6 +14,8 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= +github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -42,7 +44,6 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= @@ -51,8 +52,6 @@ github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= -github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -110,9 +109,6 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -126,6 +122,8 @@ github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lne github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/redis/go-redis/v9 v9.3.1 h1:KqdY8U+3X6z+iACvumCNxnoluToB+9Me+TvyFa21Mds= +github.com/redis/go-redis/v9 v9.3.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= 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/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= @@ -300,11 +298,9 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/inodepool_test.go b/inodepool_test.go index 7dffc50..7f0c6ba 100644 --- a/inodepool_test.go +++ b/inodepool_test.go @@ -7,10 +7,10 @@ import ( "time" "github.com/alicebob/miniredis/v2" - "github.com/go-redis/redis/v8" "github.com/libi/dcron" "github.com/libi/dcron/consistenthash" "github.com/libi/dcron/driver" + "github.com/redis/go-redis/v9" "github.com/stretchr/testify/suite" clientv3 "go.etcd.io/etcd/client/v3" "go.etcd.io/etcd/tests/v3/integration"