gpt4 book ai didi

docker - 错误:429下载deno导入时请求过多

转载 作者:行者123 更新时间:2023-12-02 19:48:25 25 4
gpt4 key购买 nike

我正在将deno与docker hayd/alpine-deno图像和denon一起使用,以查看文件更改。当我构建容器时,我得到429 Too Many Requests导入std依赖项:

...

Download https://deno.land/std@0.54.0/encoding/_yaml/type/int.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/map.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/merge.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/nil.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/omap.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/pairs.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/seq.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/set.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/str.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/timestamp.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/binary.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/bool.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/float.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/int.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/map.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/merge.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/nil.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/omap.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/pairs.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/seq.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/set.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/str.ts

Download https://deno.land/std@0.54.0/encoding/_yaml/type/timestamp.ts

error: Import 'https://deno.land/std@0.54.0/encoding/_yaml/type/timestamp.ts' failed: 429 Too Many Requests

我的外部依赖项在 deps.ts中,该文件具有以下导入:
export { Application, Router } from 'https://deno.land/x/oak/mod.ts'
export { connect } from 'https://deno.land/x/redis/mod.ts'

除了Denon导入外,没有其他外部依赖项。

我用来运行的Dockerfile:
FROM hayd/alpine-deno:1.0.1

ENV DENO_DIR /cache

EXPOSE 4000

WORKDIR /app/

COPY . .

RUN deno install --allow-read --allow-run --allow-write -f --unstable https://deno.land/x/denon/denon.ts
RUN deno cache src/deps.ts

ENTRYPOINT ["/root/.deno/bin/denon"]

CMD ["run", "--allow-net", "src/mod.ts"]

看来许多文件已多次下载(或尝试下载,失败和重试)。这并非总是会发生,但通常足以破坏构建自动化。有人遇到过类似的问题吗?缓存导入是否有问题?

最佳答案

Is it an issue with caching the imports?



不,缓存与它无关。
deno.land似乎有速率限制,您已经超出了这些限制。您可以做的是直接使用github,这很可能会有更高的限制。

供天龙使用
https://raw.githubusercontent.com/denosaurs/denon/master/denon.ts

您还可以更改代码依赖性:

https://deno.land/x/oak/mod.ts更改 https://raw.githubusercontent.com/oakserver/oak/master/mod.ts
对于 redis,您应该使用 https://raw.githubusercontent.com/keroxp/deno-redis/master/mod.ts
https://deno.land/x只是URL重写服务器,因此,最后,您实际上是从Github中提取的。

deno.land/x is a URL rewriting service for Deno scripts. The basic format of code URLs is https://deno.land/x/MODULE_NAME@BRANCH/SCRIPT.ts. If you leave out the branch, it will default to the module’s default branch, usually master.



您应该使用带标签的发行版而不是 master,否则您的docker镜像将不会始终具有相同的Oak代码。

对于 v4.0.0
export { Application, Router } from 'https://github.com/oakserver/oak/blob/v4.0.0/mod.ts'
export { connect } from 'https://raw.githubusercontent.com/keroxp/deno-redis/v0.10.1/mod.ts

关于docker - 错误:429下载deno导入时请求过多,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62261323/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com