Skip to content

Commit

Permalink
add a small precompile workload (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC authored May 3, 2023
1 parent 3ed0f08 commit 246504e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Downloads.jl
Original file line number Diff line number Diff line change
Expand Up @@ -465,4 +465,15 @@ function default_downloader!(
end
end

# Precompile
let
d = Downloader(; grace=0.01)
download("file://" * @__FILE__; downloader=d)
# Ref https://github.com/JuliaLang/julia/issues/49513
# we wait for the grace task to finish
sleep(0.05)
precompile(Tuple{typeof(Downloads.download), String, String})
precompile(Tuple{typeof(Downloads.Curl.status_2xx_ok), Int64})
end

end # module

0 comments on commit 246504e

Please sign in to comment.