diff --git a/README.md b/README.md index 9e4387e7..696a4762 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![godoc](https://pkg.go.dev/badge/gopkg.in/dtapps/go-library.v3?status.svg)](https://pkg.go.dev/gopkg.in/dtapps/go-library.v3) [![goproxy.cn](https://goproxy.cn/stats/gopkg.in/dtapps/go-library.v3/badges/download-count.svg)](https://goproxy.cn/stats/gopkg.in/dtapps/go-library.v3) [![goreportcard.com](https://goreportcard.com/badge/gopkg.in/dtapps/go-library.v3)](https://goreportcard.com/report/gopkg.in/dtapps/go-library.v3) -[![deps.dev](https://img.shields.io/badge/deps-go-red.svg)](https://deps.dev/go/github.com%2Fdtapps%2Fgo-library) +[![deps.dev](https://img.shields.io/badge/deps-go-red.svg)](https://deps.dev/go/gopkg.in%2Fdtapps%2Fgo-library.v3) [![Coverage Status](https://coveralls.io/repos/github/dtapps/go-library/badge.svg?branch=master)](https://coveralls.io/github/dtapps/go-library?branch=master) [![Sourcegraph](https://sourcegraph.com/github.com/dtapps/go-library/-/badge.svg)](https://sourcegraph.com/github.com/dtapps/go-library?badge) [![Build status](https://ci.appveyor.com/api/projects/status/d6rq6xynt8wkev5k?svg=true)](https://ci.appveyor.com/project/dtapps/go-library) diff --git a/service/wechatminiprogram/cgi-bin.token.monitor.go b/service/wechatminiprogram/cgi-bin.token.monitor.go index a26d9690..f5eb4231 100644 --- a/service/wechatminiprogram/cgi-bin.token.monitor.go +++ b/service/wechatminiprogram/cgi-bin.token.monitor.go @@ -46,7 +46,7 @@ func (app *App) AuthGetAccessTokenMonitor(qdType string) error { if token.Result.AccessToken == "" { return errors.New("获取AccessToken失败") } - redis.NewStringOperation().Set(cacheName, token.Result.AccessToken, goredis.WithExpire(time.Minute*7000)) + redis.NewStringOperation().Set(cacheName, token.Result.AccessToken, goredis.WithExpire(time.Second*7000)) return nil default: return errors.New("驱动类型不在范围内") diff --git a/service/wechatminiprogram/cgi-bin.token.rdb.go b/service/wechatminiprogram/cgi-bin.token.rdb.go index 723e5ede..eb770ae9 100644 --- a/service/wechatminiprogram/cgi-bin.token.rdb.go +++ b/service/wechatminiprogram/cgi-bin.token.rdb.go @@ -11,7 +11,7 @@ func (app *App) GetAccessTokenRDb() string { redis := goredis.App{ Rdb: app.RDb, } - newCache := redis.NewSimpleStringCache(redis.NewStringOperation(), time.Minute*7000) + newCache := redis.NewSimpleStringCache(redis.NewStringOperation(), time.Second*7000) newCache.DBGetter = func() string { token := app.AuthGetAccessToken() return token.Result.AccessToken diff --git a/service/wechatoffice/cgi-bin.token.monitor.go b/service/wechatoffice/cgi-bin.token.monitor.go index 8984c44c..94e8aa02 100644 --- a/service/wechatoffice/cgi-bin.token.monitor.go +++ b/service/wechatoffice/cgi-bin.token.monitor.go @@ -46,7 +46,7 @@ func (app *App) AuthGetAccessTokenMonitor(qdType string) error { if token.Result.AccessToken == "" { return errors.New("获取AccessToken失败") } - redis.NewStringOperation().Set(cacheName, token.Result.AccessToken, goredis.WithExpire(time.Minute*7000)) + redis.NewStringOperation().Set(cacheName, token.Result.AccessToken, goredis.WithExpire(time.Second*7000)) return nil default: return errors.New("驱动类型不在范围内") diff --git a/service/wechatoffice/cgi-bin.token.rdb.go b/service/wechatoffice/cgi-bin.token.rdb.go index 040fe5a9..139874a8 100644 --- a/service/wechatoffice/cgi-bin.token.rdb.go +++ b/service/wechatoffice/cgi-bin.token.rdb.go @@ -11,7 +11,7 @@ func (app *App) GetAccessTokenRDb() string { redis := goredis.App{ Rdb: app.RDb, } - newCache := redis.NewSimpleStringCache(redis.NewStringOperation(), time.Minute*7000) + newCache := redis.NewSimpleStringCache(redis.NewStringOperation(), time.Second*7000) newCache.DBGetter = func() string { token := app.AuthGetAccessToken() return token.Result.AccessToken diff --git a/service/wechatoffice/getticket.rdb.go b/service/wechatoffice/getticket.rdb.go index 1fde4f9f..961b8573 100644 --- a/service/wechatoffice/getticket.rdb.go +++ b/service/wechatoffice/getticket.rdb.go @@ -12,7 +12,7 @@ func (app *App) GetJsapiTicketRDb() string { redis := goredis.App{ Rdb: app.RDb, } - newCache := redis.NewSimpleStringCache(redis.NewStringOperation(), time.Minute*7000) + newCache := redis.NewSimpleStringCache(redis.NewStringOperation(), time.Second*7000) newCache.DBGetter = func() string { token := app.GetTicket(app.GetAccessTokenRDb(), "jsapi") return token.Result.Ticket diff --git a/service/wechatunion/cgi-bin.token.monitor.go b/service/wechatunion/cgi-bin.token.monitor.go index 8f5efef6..cc519c3e 100644 --- a/service/wechatunion/cgi-bin.token.monitor.go +++ b/service/wechatunion/cgi-bin.token.monitor.go @@ -46,7 +46,7 @@ func (app *App) AuthGetAccessTokenMonitor(qdType string) error { if token.Result.AccessToken == "" { return errors.New("获取AccessToken失败") } - redis.NewStringOperation().Set(cacheName, token.Result.AccessToken, goredis.WithExpire(time.Minute*7000)) + redis.NewStringOperation().Set(cacheName, token.Result.AccessToken, goredis.WithExpire(time.Second*7000)) return nil default: return errors.New("驱动类型不在范围内") diff --git a/service/wechatunion/cgi-bin.token.rdb.go b/service/wechatunion/cgi-bin.token.rdb.go index bb7397e8..8618f184 100644 --- a/service/wechatunion/cgi-bin.token.rdb.go +++ b/service/wechatunion/cgi-bin.token.rdb.go @@ -11,7 +11,7 @@ func (app *App) GetAccessTokenRDb() string { redis := goredis.App{ Rdb: app.RDb, } - newCache := redis.NewSimpleStringCache(redis.NewStringOperation(), time.Minute*7000) + newCache := redis.NewSimpleStringCache(redis.NewStringOperation(), time.Second*7000) newCache.DBGetter = func() string { token := app.AuthGetAccessToken() return token.Result.AccessToken