Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/ucode/custom_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from ucode.constants import LOCALHOST, LOOPBACK_HOST
from ucode.databricks import (
build_auth_token_argv,
clear_databricks_token_cache,
databricks_cli_path,
ensure_databricks_cli_version,
external_bearer_configured,
Expand Down Expand Up @@ -168,7 +169,10 @@ def ensure_custom_oauth_cli_token(
"--scopes",
",".join(scope for scope in config["scopes"] if scope != "offline_access"),
]
run(login_args, timeout=CUSTOM_OAUTH_TIMEOUT_MS // 1000)
try:
run(login_args, timeout=CUSTOM_OAUTH_TIMEOUT_MS // 1000)
finally:
clear_databricks_token_cache()
return get_databricks_token(workspace, profile)


Expand Down
Loading
Loading