Skip to content

Commit d5d5059

Browse files
committed
add to _authenticate
1 parent 6107837 commit d5d5059

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/authentication.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,15 @@ end
259259
function _authenticate(
260260
server_uri::URIs.URI; force::Bool, maxcount::Integer, hook::Union{Base.Callable, Nothing}
261261
)
262+
# So this is a bit weird, but we want to ensure that the global _LOCAL_TZ[] is initialized
263+
# in a somewhat reliable way. Generally, constructing the authentication object is the first
264+
# thing that you do in a session, so we just call _localtz() here, even though we don't
265+
# need it. This will ensure that the _LOCAL_TZ[] timezone object "cache" is populated
266+
# as soon as you start using JuliaHub.jl, but _not_ when you load it, due to the effect
267+
# that has on load time -- this function is pretty heavy, so the _localtz() call is not
268+
# significant anyway.
269+
_localtz()
270+
262271
isnothing(hook) || PkgAuthentication.register_open_browser_hook(hook)
263272
try
264273
# _authenticate either returns a valid token, or throws

0 commit comments

Comments
 (0)