Turn off retries on CLI (#4918)
For the CLI it just ends up confusing people as to why it's "hanging" before returning a 500. This can still be overridden with VAULT_MAX_RETRIES.
This commit is contained in:
parent
8433bf26e9
commit
a2b88fa239
|
@ -6,6 +6,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
@ -88,6 +89,11 @@ func (c *BaseCommand) Client() (*api.Client, error) {
|
||||||
return nil, errors.Wrap(err, "failed to create client")
|
return nil, errors.Wrap(err, "failed to create client")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Turn off retries on the CLI
|
||||||
|
if os.Getenv(api.EnvVaultMaxRetries) == "" {
|
||||||
|
client.SetMaxRetries(0)
|
||||||
|
}
|
||||||
|
|
||||||
// Set the wrapping function
|
// Set the wrapping function
|
||||||
client.SetWrappingLookupFunc(c.DefaultWrappingLookupFunc)
|
client.SetWrappingLookupFunc(c.DefaultWrappingLookupFunc)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package command
|
package command
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
@ -35,6 +36,11 @@ func (p *Predict) Client() *api.Client {
|
||||||
client.SetToken(token)
|
client.SetToken(token)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Turn off retries for prediction
|
||||||
|
if os.Getenv(api.EnvVaultMaxRetries) == "" {
|
||||||
|
client.SetMaxRetries(0)
|
||||||
|
}
|
||||||
|
|
||||||
p.client = client
|
p.client = client
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue