FileCodeBox icon indicating copy to clipboard operation
FileCodeBox copied to clipboard

30s接口会超时

Open leijingchao opened this issue 5 months ago • 6 comments

docker compose部署,镜像:lanol/filecodebox:latest

leijingchao avatar Sep 28 '25 03:09 leijingchao

我这稍微大一点的文件,上传时间有点长,报错:上传失败,请稍后再试,控制台没有报错信息。 是不是就是因为这个30s接口会超时?

Moriarty6086 avatar Sep 29 '25 14:09 Moriarty6086

我这稍微大一点的文件,上传时间有点长,报错:上传失败,请稍后再试,控制台没有报错信息。 是不是就是因为这个30s接口会超时?

+1,上传大文件到一半就失败,我刚开始以为是反代问题,后来发现ip直连也是这样。再后来发现从点击上传后第30秒就会失败,并且没有日志。

GaoshuoZhang avatar Sep 30 '25 02:09 GaoshuoZhang

这是 docker 网络默认超时问题,在docker-compose.yml里的 command 加上修改超时时间就能解决了,搭配分片上传目前上传 5Gb 文件无任何问题

luyii-code-1 avatar Oct 02 '25 15:10 luyii-code-1

找到问题了,2024主题的前端代码中没有设置axios请求超时时间 [timeout]。 themes/2024/assets/index-B-Ka-o3f.js be=async o=>{ const e=new FormData, i={ headers:{"Content-Type":"multipart/form-data"}, **timeout: 3600000, // 添加超时配置** onUploadProgress:h=>{ const w=Math.round(h.loaded*100/(h.total||1)); y.value=w } }; return e.append("file",o), e.append("expire_value",l.value), e.append("expire_style",c.value), await L.post("share/file/",e,i) }

GaoshuoZhang avatar Oct 05 '25 06:10 GaoshuoZhang

拉个Pr上去吧

---原始邮件--- 发件人: "G @.> 发送时间: 2025年10月5日(周日) 下午2:46 收件人: @.>; 抄送: @.@.>; 主题: Re: [vastsa/FileCodeBox] 30s接口会超时 (Issue #408)

GaoshuoZhang left a comment (vastsa/FileCodeBox#408)

找到问题了,2024主题的前端代码中没有设置axios请求超时时间。 themes/2024/assets/index-B-Ka-o3f.js javascript be=async o=>{ const e=new FormData, i={ headers:{"Content-Type":"multipart/form-data"}, timeout: 3600000, // 添加超时配置 onUploadProgress:h=>{ const w=Math.round(h.loaded*100/(h.total||1)); y.value=w } }; return e.append("file",o), e.append("expire_value",l.value), e.append("expire_style",c.value), await L.post("share/file/",e,i) }

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

luyii-code-1 avatar Oct 05 '25 06:10 luyii-code-1

感谢反馈,这边尽快修复

vastsa avatar Oct 07 '25 00:10 vastsa