Closed januwA closed 2 years ago
@januwA 确定下是否启用了 tokio1
feature
并没有
qiniu-sdk = { version = "0.1", features = [
"utils",
"etag",
"credential",
"upload",
"upload-token",
"http",
"http-client",
"reqwest",
"apis",
"objects",
"async",
], optional = true }
@januwA 哦 我知道了 你不应该用 reqwest 的,可以用 isahc 替换 reqwest,我估计你程序里没有 tokio 运行时,所以 reqwest 没法工作
我也不清楚,但我好像有tokio的运行时
[dependencies]
actix-web = "4"
tokio = { version = "1", features = ["full"] }
@januwA tokio 运行时是要启动才能生效的,一般在 actix-web 里 用的是 actix-rt 这个运行时,当然你也可以用 tokio::task::spawn
启动 tokio 来执行 reqwest 库,只是可能这里不是太有必要。
您好,我再上传一张21M的图片时直接panic,我测试小图片(小于4M)没有问题。
这是代码片段
这是报错信息
我在actix-web4中使用
开启
RUST_BACKTRACE=1
的信息github会出现 注释太长(最多65536个字符) 的错误信息,这里我上传文件 out.txt