Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use PkgServerClient to choose the best mirror server as pkg server #121

Merged
merged 1 commit into from
Oct 8, 2021

Conversation

johnnychen94
Copy link
Member

@johnnychen94 johnnychen94 commented Mar 29, 2021

closes #120

我将镜像站的切换功能重写到 PkgServerClient 里面了,并且增加了自动切换到最近的镜像站的功能:

julia> versioninfo()
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.6.0)
  CPU: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)

julia> using JuliaZH

julia> versioninfo()
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.6.0)
  CPU: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
  JULIA_PKG_SERVER = https://opentuna.cn/julia

julia> using JuliaZH: PkgServerClient

# 测试镜像站延迟
julia> PkgServerClient.registry_response_time()
Dict{String, Float64} with 8 entries:
  "BFSU"      => 0.106639
  "OpenTUNA"  => 0.335531
  "SJTUG"     => 0.101141
  "USTC"      => 0.0674178
  "SUSTech"   => 0.0906177
  "TUNA"      => 0.114346
  "JuliaLang" => 0.844634
  "NJU"       => 0.0908128

因为是选择延迟最低的镜像站,所以 JULIA_PKG_SERVER 的具体值是不确定的。之前我们是硬编码到了BFSU.

这个PR之后我们需要更新上游镜像站的帮助文档。

@Gnimuc
Copy link
Member

Gnimuc commented Oct 3, 2021

off-topic:

Platform Info:
OS: macOS (x86_64-apple-darwin19.6.0)
CPU: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz

你这 CPU 🤩 🥰 😍

@johnnychen94 johnnychen94 merged commit 7bca1c9 into master Oct 8, 2021
@johnnychen94 johnnychen94 deleted the jc/more_mirrors branch October 8, 2021 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add mirrors: sustech and NJU
2 participants