Skip to content

Commit 246504e

Browse files
authored
add a small precompile workload (#226)
1 parent 3ed0f08 commit 246504e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Downloads.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,4 +465,15 @@ function default_downloader!(
465465
end
466466
end
467467

468+
# Precompile
469+
let
470+
d = Downloader(; grace=0.01)
471+
download("file://" * @__FILE__; downloader=d)
472+
# Ref https://github.com/JuliaLang/julia/issues/49513
473+
# we wait for the grace task to finish
474+
sleep(0.05)
475+
precompile(Tuple{typeof(Downloads.download), String, String})
476+
precompile(Tuple{typeof(Downloads.Curl.status_2xx_ok), Int64})
477+
end
478+
468479
end # module

0 commit comments

Comments
 (0)