Atomically releases a proxy session for a task. Under a per-fingerprint lock, this method: 1. Cleans up the agent network (disconnect + remove) 2. Stops the proxy if no other agents are connected
(&self, session: &ProxySession)
| 485 | /// 1. Cleans up the agent network (disconnect + remove) |
| 486 | /// 2. Stops the proxy if no other agents are connected |
| 487 | pub async fn release_proxy(&self, session: &ProxySession) { |
| 488 | self.sync_manager |
| 489 | .with_lock(&session.fingerprint, || async { |
| 490 | self.cleanup_agent_network(&session.proxy_container_name, &session.network_name) |
| 491 | .await; |
| 492 | self.maybe_stop_proxy_by_name(&session.proxy_container_name) |
| 493 | .await; |
| 494 | }) |
| 495 | .await; |
| 496 | } |
| 497 | |
| 498 | /// Stops the proxy if no agents are connected, without acquiring the lock. |
| 499 | /// |