From d72598e5d32593eaa2e78f68d829206f5d50d0a4 Mon Sep 17 00:00:00 2001 From: jonathan-d-zhang <69145546+jonathan-d-zhang@users.noreply.github.com> Date: Tue, 23 Jul 2024 20:33:30 -0400 Subject: [PATCH] feat: Remove delay when a package is found --- src/main.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 8b46999..06f0635 100644 --- a/src/main.rs +++ b/src/main.rs @@ -73,11 +73,15 @@ fn main() -> Result<()> { } } - Ok(None) => info!("No job found"), + Ok(None) => { + info!("No job found"); + std::thread::sleep(Duration::from_secs(APP_CONFIG.load_duration)); + } - Err(err) => error!("Unexpected HTTP error: {err}"), + Err(err) => { + error!("Unexpected HTTP error: {err}"); + std::thread::sleep(Duration::from_secs(APP_CONFIG.load_duration)); + } } - - std::thread::sleep(Duration::from_secs(APP_CONFIG.load_duration)); } }