mirror of
https://github.com/openai/codex.git
synced 2026-05-05 05:42:33 +03:00
nits in exec server
This commit is contained in:
@@ -310,7 +310,13 @@ impl ExecServerClient {
|
||||
pub(crate) async fn register_session(
|
||||
&self,
|
||||
process_id: &str,
|
||||
) -> Result<broadcast::Receiver<ExecSessionEvent>, ExecServerError> {
|
||||
) -> Result<
|
||||
(
|
||||
broadcast::Sender<ExecSessionEvent>,
|
||||
broadcast::Receiver<ExecSessionEvent>,
|
||||
),
|
||||
ExecServerError,
|
||||
> {
|
||||
let (events_tx, events_rx) = broadcast::channel(256);
|
||||
let mut sessions = self.inner.sessions.lock().await;
|
||||
if sessions.contains_key(process_id) {
|
||||
@@ -318,8 +324,8 @@ impl ExecServerClient {
|
||||
"session already registered for process {process_id}"
|
||||
)));
|
||||
}
|
||||
sessions.insert(process_id.to_string(), events_tx);
|
||||
Ok(events_rx)
|
||||
sessions.insert(process_id.to_string(), events_tx.clone());
|
||||
Ok((events_tx, events_rx))
|
||||
}
|
||||
|
||||
pub(crate) async fn unregister_session(&self, process_id: &str) {
|
||||
|
||||
Reference in New Issue
Block a user