Fix corked AUTH subscriptions

This commit is contained in:
Mike Dilger 2024-06-18 11:59:24 +12:00
parent 95113c43c0
commit 168482bf86
2 changed files with 2 additions and 2 deletions

View File

@ -165,6 +165,7 @@ impl Minion {
// Auth failed.
tracing::warn!("AUTH failed to {}: {}", &self.url, ok_message);
} else {
tracing::info!("Authenticated to {}", &self.url);
self.auth_state = AuthState::Authenticated;
self.try_subscribe_waiting().await?;
}

View File

@ -1077,7 +1077,7 @@ impl Minion {
}
// If we are authenticated
if self.auth_state != AuthState::Authenticated {
if self.auth_state == AuthState::Authenticated {
// Apply subscriptions that were waiting for auth
let mut handles = std::mem::take(&mut self.subscriptions_waiting_for_auth);
let now = Unixtime::now().unwrap();
@ -1327,7 +1327,6 @@ impl Minion {
self.last_message_sent = wire.clone();
let ws_stream = self.stream.as_mut().unwrap();
ws_stream.send(WsMessage::Text(wire)).await?;
tracing::info!("Authenticated to {}", &self.url);
self.auth_state = AuthState::Waiting(id);