mirror of
https://github.com/telemt/telemt.git
synced 2026-11-02 13:52:03 +03:00
Atomic Lifecycle for Writer Refresh + Hardswap
This commit is contained in:
@@ -22,6 +22,7 @@ pub(super) async fn live_active_writers_for_dc_family(
|
||||
dc: i32,
|
||||
family: IpFamily,
|
||||
) -> usize {
|
||||
let active_generation = pool.current_generation();
|
||||
let writers = pool.writers.read().await;
|
||||
writers
|
||||
.iter()
|
||||
@@ -32,6 +33,9 @@ pub(super) async fn live_active_writers_for_dc_family(
|
||||
if writer.writer_dc != dc {
|
||||
return false;
|
||||
}
|
||||
if writer.generation != active_generation {
|
||||
return false;
|
||||
}
|
||||
if !matches!(
|
||||
crate::transport::middle_proxy::pool::WriterContour::from_u8(
|
||||
writer.contour.load(std::sync::atomic::Ordering::Relaxed),
|
||||
|
||||
Reference in New Issue
Block a user