This commit is contained in:
Bojan Serafimov
2022-05-24 23:24:03 -04:00
parent aee8615b30
commit 14b8dcab5b
2 changed files with 9 additions and 10 deletions

View File

@@ -318,7 +318,7 @@ fn start_pageserver(conf: &'static PageServerConf, daemonize: bool) -> Result<()
None,
&name.clone(),
true,
move || GC_POOL.get().unwrap().worker_main(name.clone()),
move || GC_POOL.get().unwrap().worker_main(name),
)
.unwrap();
}
@@ -333,7 +333,7 @@ fn start_pageserver(conf: &'static PageServerConf, daemonize: bool) -> Result<()
None,
&name.clone(),
true,
move || GC_POOL.get().unwrap().worker_main(name.clone()),
move || GC_POOL.get().unwrap().worker_main(name),
)
.unwrap();
}

View File

@@ -5,10 +5,9 @@ use std::{
collections::{BinaryHeap, HashMap},
fmt::Debug,
hash::Hash,
ops::Add,
panic::{self, AssertUnwindSafe},
sync::{Condvar, Mutex},
time::{Duration, Instant},
time::Instant,
};
lazy_static! {
@@ -85,7 +84,7 @@ where
impl<J: Job> Eq for Deadline<J> where J::ErrorType: Debug {}
#[derive(Debug)]
#[derive(Debug, Default)]
struct JobStatusTable<J: Job>
where
J::ErrorType: Debug,
@@ -116,7 +115,7 @@ where
}
}
#[derive(Debug)]
#[derive(Debug, Default)]
pub struct Pool<J: Job>
where
J::ErrorType: Debug,
@@ -210,7 +209,7 @@ where
.status
.insert(job.clone(), JobStatus::Ready { scheduled_for });
job_table.queue.push(Deadline {
job: job.clone(),
job,
start_by: scheduled_for,
});
@@ -220,7 +219,7 @@ where
#[cfg(test)]
mod tests {
use std::time::Duration;
use std::{ops::Add, time::Duration};
use once_cell::sync::OnceCell;
@@ -251,7 +250,7 @@ mod tests {
TEST_POOL.set(Pool::<PrintJob>::new()).unwrap();
thread_mgr::spawn(
ThreadKind::GarbageCollector, // change this
ThreadKind::GarbageCollectionWorker,
None,
None,
"test_worker_1",
@@ -261,7 +260,7 @@ mod tests {
.unwrap();
thread_mgr::spawn(
ThreadKind::GarbageCollector, // change this
ThreadKind::GarbageCollectionWorker,
None,
None,
"test_worker_2",