mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-15 09:22:55 +00:00
refactor: unify t::s::Semaphore
This commit is contained in:
@@ -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
|
||||
}();
|
||||
|
||||
Reference in New Issue
Block a user