refactor: make kathy sleep at top of loop (#749)

buddies-main-deployment
James Prestwich 3 years ago committed by GitHub
parent b02af4c71f
commit 885cf819c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      rust/agents/kathy/src/kathy.rs

@ -65,6 +65,8 @@ impl OpticsAgent for Kathy {
let destination = replica.local_domain(); let destination = replica.local_domain();
loop { loop {
sleep(duration).await;
let msg = generator.gen_chat(); let msg = generator.gen_chat();
let recipient = generator.gen_recipient(); let recipient = generator.gen_recipient();
@ -89,8 +91,6 @@ impl OpticsAgent for Kathy {
return Ok(()); return Ok(());
} }
} }
sleep(duration).await;
} }
}) })
.in_current_span() .in_current_span()

Loading…
Cancel
Save