diff options
Diffstat (limited to 'src/watch/scheduler.rs')
| -rw-r--r-- | src/watch/scheduler.rs | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/src/watch/scheduler.rs b/src/watch/scheduler.rs index 837a51a..eb79db0 100644 --- a/src/watch/scheduler.rs +++ b/src/watch/scheduler.rs @@ -6,7 +6,6 @@ use crate::config::Config; use crate::db::{self, Db}; use crate::watch::detect::check_pkgbase; -/// Spawn the watcher tick thread. pub fn spawn_scheduler(cfg: Arc<Config>, db: Db, stop: Arc<AtomicBool>) -> JoinHandle<()> { std::thread::Builder::new() .name("watcher".into()) @@ -14,7 +13,6 @@ pub fn spawn_scheduler(cfg: Arc<Config>, db: Db, stop: Arc<AtomicBool>) -> JoinH while !stop.load(Ordering::SeqCst) { let tick = crate::db::setting_i64(&db, "poll_tick", 30); sweep(&cfg, &db); - // Sleep in small slices so shutdown is prompt. let mut slept = 0; while slept < tick && !stop.load(Ordering::SeqCst) { std::thread::sleep(std::time::Duration::from_secs(1)); @@ -25,7 +23,6 @@ pub fn spawn_scheduler(cfg: Arc<Config>, db: Db, stop: Arc<AtomicBool>) -> JoinH .expect("spawn watcher") } -/// One sweep over everything that is due. pub fn sweep(cfg: &Config, db: &Db) -> usize { let now = crate::time::now(); let due = match db::due_subscriptions(db, &now) { |
