Fiat: fix excessive logins
This commit is contained in:
parent
c693d11a60
commit
270a29a36d
1 changed files with 1 additions and 1 deletions
|
|
@ -195,7 +195,7 @@ func (v *Identity) UID() string {
|
||||||
// Sign signs an AWS request using identity's credentials
|
// Sign signs an AWS request using identity's credentials
|
||||||
func (v *Identity) Sign(req *http.Request, body io.ReadSeeker) error {
|
func (v *Identity) Sign(req *http.Request, body io.ReadSeeker) error {
|
||||||
// refresh credentials
|
// refresh credentials
|
||||||
if v.creds.Expiration.After(time.Now().Add(-time.Minute)) {
|
if v.creds.Expiration.Before(time.Now().Add(-time.Minute)) {
|
||||||
if err := v.Login(); err != nil {
|
if err := v.Login(); err != nil {
|
||||||
return fmt.Errorf("login failed: %w", err)
|
return fmt.Errorf("login failed: %w", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue