Skip to content

Commit fa826e0

Browse files
committed
enable --cmd for archived mode
1 parent a6abd55 commit fa826e0

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

src/main.rs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,26 @@ async fn main() -> anyhow::Result<()> {
108108
if args.archived {
109109
let (tx, mut rx) = mpsc::channel(1);
110110

111-
tokio::spawn(async move {
112-
stdin::streaming(
113-
tx,
114-
Duration::from_millis(args.retrieval_timeout_millis),
115-
CancellationToken::new(),
116-
)
117-
.await
118-
});
111+
if let Some(cmd) = args.cmd.clone() {
112+
tokio::spawn(async move {
113+
cmd::execute(
114+
&cmd,
115+
tx,
116+
Duration::from_millis(args.retrieval_timeout_millis),
117+
CancellationToken::new(),
118+
)
119+
.await
120+
});
121+
} else {
122+
tokio::spawn(async move {
123+
stdin::streaming(
124+
tx,
125+
Duration::from_millis(args.retrieval_timeout_millis),
126+
CancellationToken::new(),
127+
)
128+
.await
129+
});
130+
}
119131

120132
let mut queue = VecDeque::with_capacity(args.queue_capacity);
121133
loop {

0 commit comments

Comments
 (0)