Skip to content

Commit c364458

Browse files
committed
better names for variables.
1 parent 294ed43 commit c364458

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

auth.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ func prepareJWTToken(config *Config) (string, error) {
589589

590590
// Quality of life features for externalbrowser
591591
var lastFail sync.Map // key -> time.Time (expiry)
592-
const expBackoffWindow = 10 * time.Second
592+
const extBrowserBackoffWindow = 10 * time.Second
593593

594594
func normalizeHost(h string) string {
595595
if strings.HasPrefix(h, "http://") || strings.HasPrefix(h, "https://") {
@@ -603,7 +603,7 @@ func normalizeHost(h string) string {
603603
return strings.ToLower(h)
604604
}
605605

606-
func expBackoffKey(host, user string) string {
606+
func extBrowserBackoffKey(host, user string) string {
607607
return normalizeHost(host) + "|" + strings.ToUpper(user)
608608
}
609609

@@ -621,7 +621,7 @@ func authenticateWithConfig(sc *snowflakeConn) error {
621621
}
622622
defer lease.Release()
623623

624-
key := expBackoffKey(sc.cfg.Host, sc.cfg.User)
624+
key := extBrowserBackoffKey(sc.cfg.Host, sc.cfg.User)
625625

626626
if sc.cfg.Authenticator == AuthTypeExternalBrowser || sc.cfg.Authenticator == AuthTypeOAuthAuthorizationCode || sc.cfg.Authenticator == AuthTypeOAuthClientCredentials {
627627
if isCacheSupportedGOOS(runtime.GOOS) && sc.cfg.ClientStoreTemporaryCredential == configBoolNotSet {
@@ -747,7 +747,7 @@ func authenticateWithConfig(sc *snowflakeConn) error {
747747

748748
// no retry strategies saved the attempt -> record backoff + return
749749
default:
750-
lastFail.Store(key, time.Now().Add(expBackoffWindow))
750+
lastFail.Store(key, time.Now().Add(extBrowserBackoffWindow))
751751
sc.cleanup()
752752
return err
753753
}

0 commit comments

Comments
 (0)