refactor: unify t::s::Semaphore

This commit is contained in:
Joonas Koivunen
2024-07-22 11:47:50 +00:00
parent 6f28263428
commit f4d773bb89

View File

@@ -672,9 +672,7 @@ pub(super) async fn prepare(
let mut wrote_any = false;
let limiter = Arc::new(tokio::sync::Semaphore::new(
options.rewrite_concurrency.get(),
));
let limiter = Arc::new(Semaphore::new(options.rewrite_concurrency.get()));
for layer in straddling_branchpoint {
let limiter = limiter.clone();
@@ -727,7 +725,7 @@ pub(super) async fn prepare(
}
let mut tasks = tokio::task::JoinSet::new();
let limiter = Arc::new(tokio::sync::Semaphore::new(options.copy_concurrency.get()));
let limiter = Arc::new(Semaphore::new(options.copy_concurrency.get()));
for adopted in rest_of_historic {
let limiter = limiter.clone();
@@ -1060,7 +1058,7 @@ pub(super) async fn complete(
#[cfg(feature = "testing")]
let failpoint_sem = || -> Option<Arc<Semaphore>> {
fail::fail_point!("timeline-detach-ancestor::allow_one_reparented", |_| Some(
Arc::new(tokio::sync::Semaphore::new(1))
Arc::new(Semaphore::new(1))
));
None
}();