You've already forked email-api-client
stuff
This commit is contained in:
@@ -2,9 +2,8 @@ package client
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"git.s.int/golang/packages/email-api/redis"
|
||||
"git.s.int/packages/go/email-api/redis"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
@@ -69,7 +68,7 @@ func FromCache() *Token {
|
||||
|
||||
token := Token{}
|
||||
|
||||
result, err := rdb.Get(context.Background(), "api.access_token").Result()
|
||||
result, err := rdb.Get("api.access_token").Result()
|
||||
if err != nil {
|
||||
return &token
|
||||
}
|
||||
@@ -89,7 +88,7 @@ func saveCache(token *Token) {
|
||||
|
||||
expiresIn := time.Duration(int64(token.ExpiresIn) * 100000000)
|
||||
|
||||
cmd := rdb.Set(context.Background(), "api.access_token", tokenJson, expiresIn)
|
||||
cmd := rdb.Set("api.access_token", tokenJson, expiresIn)
|
||||
result, err := cmd.Result()
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user