Skip to content

Commit

Permalink
Change instance when attempting a retry
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Aug 19, 2024
1 parent a44281a commit 2d4d28f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkcs11/src/backend/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ impl LoginCtx {
{
// we loop for a maximum of instances.len() times
for _ in 0..self.instances.len() {
let conf = match self.get_config_user_mode(&user_mode) {
let mut conf = match self.get_config_user_mode(&user_mode) {
Some(conf) => conf,
None => continue,
};
Expand Down Expand Up @@ -241,6 +241,9 @@ impl LoginCtx {

warn!("Connection attempt {retry_count} failed: IO error connecting to the instance, {err}, retrying in {delay_seconds}s");
thread::sleep(delay);
if let Some(new_conf) = self.get_config_user_mode(&user_mode) {
conf = new_conf;
}
}
// Otherwise, return the error
Err(err) => return Err(err.into()),
Expand Down

0 comments on commit 2d4d28f

Please sign in to comment.