Skip to content

Commit

Permalink
feat(runner/poll_results): poll every second
Browse files Browse the repository at this point in the history
  • Loading branch information
adriencaccia committed Jul 10, 2024
1 parent 69e07fc commit 5d1a30c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/run/poll_results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use super::ci_provider::CIProvider;
use super::config::Config;

const RUN_PROCESSING_MAX_DURATION: Duration = Duration::from_secs(60 * 5); // 5 minutes
const POLLING_INTERVAL: Duration = Duration::from_secs(1);

#[allow(clippy::borrowed_box)]
pub async fn poll_results(
Expand Down Expand Up @@ -42,10 +43,10 @@ pub async fn poll_results(
.await?
{
FetchLocalRunReportResponse { run, .. } if run.status != RunStatus::Completed => {
sleep(Duration::from_secs(5)).await;
sleep(POLLING_INTERVAL).await;
}
reponse_from_api => {
response = reponse_from_api;
response_from_api => {
response = response_from_api;
break;
}
}
Expand Down

0 comments on commit 5d1a30c

Please sign in to comment.