Simple-Tracker / qBittorrent-ClientBlocker

一款适用于 qBittorrent/Transmission (Beta)/BitComet (Beta, Partial) 的客户端屏蔽器, 默认屏蔽包括但不限于迅雷等客户端. A client blocker compatible with qBittorrent/Transmission (Beta)/BitComet (Beta, Partial) which is prohibited to include but not limited to clients such as Xunlei.
MIT License
934 stars 24 forks source link

请求添加启动延迟 #14

Closed mzhboy closed 7 months ago

mzhboy commented 7 months ago

platform: Ubuntu on pi4b qee启动有些慢(平台限制)。 使用 systemd 加载 qee 和 qBittorrent-ClientBlocker。qBittorrent-ClientBlocker 在 qee 后启动( After=qbittorrent-enhanced-nox.service ),但是qee需要等一段时间才能启动webUI(忙于恢复),响应很慢。于是 qBittorrent-ClientBlocker 得不到响应,根据日志, qBittorrent-ClientBlocker 似乎没有重新尝试连接,于是希望添加延迟连接和轮询功能。这样 qb 重启后也好保证连接。 下面摘录日志。

qBittorrent-ClientBlocker

[2024-02-05 00:37:41][LoadConfig-Current] QBURL: http://localhost:8080. [2024-02-05 00:37:41][LoadConfig-Current] QBUsername: . [2024-02-05 00:37:41][LoadConfig-Current] QBPassword: . [2024-02-05 00:37:41][LoadConfig-Current] BlockList: [-(XL|SD|XF|QD|BN|DL)(\d+)- ((^(xunlei?).?\d+.\d+.\d+.\d+)|cacao_torrent) -(UW\w{4}|SP(([0-2]\d{3})|(3[0-5]\d{2})))- StellarPlayer dd. [2024-02-05 00:37:41][Submit] 请求时发生了错误: Post "http://localhost:8080/api/v2/app/setPreferences": dial tcp [::1]:8080: connect: connection refused. [2024-02-05 00:37:41][SubmitBlockPeer] 发生错误. [2024-02-05 00:37:41][RunConsole] 程序已启动. [2024-02-05 00:37:44][Fetch] 请求时发生了错误: Get "http://localhost:8080/api/v2/sync/maindata?rid=0": dial tcp [::1]:8080: connect: connection refused. [2024-02-05 00:37:44][FetchMaindata] 发生错误.

qee

qBittorrent v4.6.3.10 started [2024/2/5 00:37:42] ...... WebUI: Now listening on IP: 0.0.0.0, port: 8080 [2024/2/5 00:37:45]

Simple-Tracker commented 7 months ago

感谢反馈!

客户端在超时后通常会立即重试, 因为设定的延迟 2 秒小于超时时间 6 秒, 因此不会影响正常工作 (例外情况是: 不以服务运行即没有开启退出守护的客户端, 开启了认证功能, 则会因为认证失败直接退出). 若对此担心, 可以考虑在 Systemd 配置文件中于运行前使用 Sleep, 参见 https://stackoverflow.com/questions/43001223/how-to-ensure-that-there-is-a-delay-before-a-service-is-started-in-systemd

Simple-Tracker commented 7 months ago

Resolved! 2.7b1

mzhboy commented 7 months ago

startDelay 这个参数加到配置文件里吧,下载的默认配置文件没有这个。得读文档

Simple-Tracker commented 7 months ago

高级参数不会默认加入配置文件, 除非大量用户提出有默认加入的需求.