Skip to content

Commit

Permalink
keep track of end time of last llm msg for twitch
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Kennedy committed Mar 30, 2024
1 parent 4d137e0 commit ce5c57c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@ async fn main() {
let poll_interval = args.poll_interval;
let poll_interval_duration = Duration::from_millis(poll_interval);
let mut poll_start_time = Instant::now();
let mut poll_end_time = Instant::now();
if args.daemon {
println!(
"Starting up RsLLM with poll interval of {} seconds...",
Expand Down Expand Up @@ -877,7 +878,8 @@ async fn main() {
if !twitch_query && args.twitch_client {
if args.continuous {
// only play a story after poll_interval_duration has passed, else continue
if elapsed < poll_interval_duration {
let elapsed_end = poll_end_time.elapsed();
if elapsed_end < poll_interval_duration {
tokio::time::sleep(Duration::from_millis(100)).await;
continue;
}
Expand Down Expand Up @@ -1662,5 +1664,6 @@ async fn main() {
}
}
}
poll_end_time = Instant::now();
}
}

0 comments on commit ce5c57c

Please sign in to comment.