From a840de1f69e7cb0beef2c41f152d1198c6be6d68 Mon Sep 17 00:00:00 2001 From: Kristoffer Date: Wed, 26 Apr 2023 09:58:15 +0200 Subject: [PATCH] add a small precompile workload --- src/Downloads.jl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Downloads.jl b/src/Downloads.jl index 216aa84..6a91312 100644 --- a/src/Downloads.jl +++ b/src/Downloads.jl @@ -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