-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
feat(traffic): support limit task worker count & file stream rate #7948
New issue
Have a 10000 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
feat(traffic): support limit task worker count & file stream rate #7948
Conversation
drivers/189pc/utils.go
Outdated
err = jsoniter.Unmarshal(body, &erron) | ||
if err != nil { | ||
return nil, err | ||
} | ||
err = xml.Unmarshal(body, &erron) | ||
if err != nil { | ||
return nil, err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里别改,故意忽略错误的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@xhofe 这个前端没有合并 |
佬,这个PR的任务和 [data/ |
如果settings里没有线程数那个字段(第一次运行或者刚从旧版本升级上来的时候),会用config里的值初始化settings,如果settings里有值就会忽略config里的 |
大佬,请教下,这个PR实现的是对单个连接的限制,还是多个连接同时下载时的总速率。 |
总的 |
支持限制 6 种任务的线程数和传输上下行速率。
op.RegisterSettingChangingCallback
方法用来注册一个当设置发生修改时调用的回调函数,这使得设置修改后立即生效成为可能。xhofe/tache
升级到 v0.1.5,使用新版本的SetWorkersNumActive
方法实现运行时修改任务线程数。golang.org/x/time/rate
的Limiter
的限流器:ClientDownloadLimit
:限制/p
、/d
、/ap
、/ad
和/ae
五个API,WebDAV 服务器的 GET、POST 请求和 FTP 服务器的 RETR 命令的下行速率。ClientUploadLimit
:限制/api/fs/put
和/api/fs/form
两个API,WebDAV 服务器的 PUT 请求和 FTP 服务器的 STOR 命令的上行速率。ServerDownloadLimit
:限制stream.SeekableStream
和本地代理读取model.Link
的速率。ServerUploadLimit
:限制驱动上传model.FileStreamer
的速率,这一步需要在驱动内完成,这也是为什么这个 PR 修改了几乎所有可写驱动。Front-end part AlistGo/alist-web#250
Close #7511