Skip to content

Commit c381c36

Browse files
committed
fixed: check concurrent
1 parent 6f51667 commit c381c36

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Rss2pan
22

3-
将 Rss 订阅离线下载到网盘。目前支持 115
3+
将 Rss 订阅离线下载到 115 网盘。
44

55
## 关于
66

@@ -30,7 +30,7 @@
3030
```bash
3131
# 查看帮助
3232
rss2pan -h
33-
# 直接运行。读取 rss.json,进行添加离线任务
33+
# 直接运行。读取 rss.json,依次添加离线任务
3434
rss2pan
3535
# 并发请求 rss 网站。然后再添加 115 离线任务
3636
rss2pan -m

src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn build_app() -> Command<'static> {
2929
fn t_cmd() {
3030
let cmd = build_app();
3131
let matches = cmd.clone().try_get_matches_from(["rss2pan", "-m"]).unwrap();
32-
assert!(matches.contains_id("concurrent"));
32+
assert_eq!(matches.get_one::<bool>("concurrent").copied(), Some(true));
3333
let matches = cmd.clone().try_get_matches_from(["rss2pan"]).unwrap();
3434
assert_eq!(matches.get_one::<bool>("concurrent").copied(), Some(false));
3535
}

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async fn main() -> anyhow::Result<()> {
3333
}
3434
return Ok(());
3535
}
36-
if matches.contains_id("concurrent") {
36+
if matches.get_one::<bool>("concurrent").copied() == Some(true) {
3737
if let Err(err) = execute_tasks(&service).await {
3838
println!("{}", err);
3939
}

src/yiyiwu.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,16 @@ impl Yiyiwu {
140140
.filter(|item| !service.has_item(&item.magnet))
141141
.map(|item| &*item.magnet)
142142
.collect();
143-
// log::debug!("tasks: {:?}", tasks);
143+
// 测试用的开关
144+
if std::env::var("RSS2PAN_LOG").is_ok() {
145+
log::info!(
146+
"[RSS2PAN_LOG] [{}] [{}] has {} tasks",
147+
config.name,
148+
config.url,
149+
tasks.len()
150+
);
151+
continue;
152+
}
144153
if tasks.len() == 0 {
145154
log::info!("[{}] has 0 task", config.name);
146155
continue;

0 commit comments

Comments
 (0)