mirror of
https://github.com/plutov/paypal.git
synced 2025-01-23 10:21:03 +01:00
revert of time.Until which fails on 1.5,1.6, & 1.7
This commit is contained in:
parent
2c6b470ed7
commit
cc05027dd1
|
@ -129,7 +129,7 @@ func (c *Client) SendWithAuth(req *http.Request, v interface{}) error {
|
||||||
// to happen outside of the locked section.
|
// to happen outside of the locked section.
|
||||||
|
|
||||||
if c.Token != nil {
|
if c.Token != nil {
|
||||||
if !c.tokenExpiresAt.IsZero() && time.Until(c.tokenExpiresAt) < RequestNewTokenBeforeExpiresIn {
|
if !c.tokenExpiresAt.IsZero() && c.tokenExpiresAt.Sub(time.Now()) < RequestNewTokenBeforeExpiresIn {
|
||||||
// c.Token will be updated in GetAccessToken call
|
// c.Token will be updated in GetAccessToken call
|
||||||
if _, err := c.GetAccessToken(); err != nil {
|
if _, err := c.GetAccessToken(); err != nil {
|
||||||
c.Unlock()
|
c.Unlock()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user