mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-08-05 16:33:40 +02:00
ef234f143b
GlobalRateLimiter.acquire() enforced the inter-message gap inside an async-with that released the lock before returning, so the caller's radio transmission ran with no lock held and every room's sync loop could push concurrently. acquire() now returns with the lock held (released via release() in a finally, including on cancellation during the gap wait), uses a monotonic clock so wall-clock jumps cannot skip or stretch the gap, and push_post_to_client acquires it only around the sync-state write plus the blocking send, so the ACK-timeout clock starts when the transmission actually begins. Regression tests cover two rooms sharing one limiter (no concurrent sends, gap enforced) and lock release when the send raises.