diff --git a/secret_store/src/key_server_cluster/admin_sessions/key_version_negotiation_session.rs b/secret_store/src/key_server_cluster/admin_sessions/key_version_negotiation_session.rs index 19fef08bc..1fb3a3fe6 100644 --- a/secret_store/src/key_server_cluster/admin_sessions/key_version_negotiation_session.rs +++ b/secret_store/src/key_server_cluster/admin_sessions/key_version_negotiation_session.rs @@ -191,9 +191,9 @@ impl SessionImpl where T: SessionTransport { self.data.lock().continue_with = Some(action); } - /// Get continue action. - pub fn continue_action(&self) -> Option { - self.data.lock().continue_with.clone() + /// Take continue action. + pub fn take_continue_action(&self) -> Option { + self.data.lock().continue_with.take() } /// Wait for session completion. diff --git a/secret_store/src/key_server_cluster/cluster.rs b/secret_store/src/key_server_cluster/cluster.rs index d5f4b776b..0f8ebdd60 100644 --- a/secret_store/src/key_server_cluster/cluster.rs +++ b/secret_store/src/key_server_cluster/cluster.rs @@ -471,7 +471,7 @@ impl ClusterCore { if is_master_node && session.is_finished() { data.sessions.negotiation_sessions.remove(&session.id()); match session.wait() { - Ok((version, master)) => match session.continue_action() { + Ok((version, master)) => match session.take_continue_action() { Some(ContinueAction::Decrypt(session, is_shadow_decryption)) => { let initialization_error = if data.self_key_pair.public() == &master { session.initialize(version, is_shadow_decryption, false) @@ -498,7 +498,7 @@ impl ClusterCore { }, None => (), }, - Err(error) => match session.continue_action() { + Err(error) => match session.take_continue_action() { Some(ContinueAction::Decrypt(session, _)) => { data.sessions.decryption_sessions.remove(&session.id()); session.on_session_error(&meta.self_node_id, error);