Skip to content

Commit eb6b8f5

Browse files
author
Nils Bars
committed
Log key refresh only when keys actually changed
Compare full key contents instead of just the count to detect additions, removals, and replacements.
1 parent bde0d2b commit eb6b8f5

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

ssh-reverse-proxy/src/server.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,14 +1013,13 @@ fn spawn_key_refresh_task(
10131013
match api_client.get_keys().await {
10141014
Ok(keys) => {
10151015
let mut cache = valid_keys.lock().await;
1016-
let old_count = cache.len();
1017-
*cache = keys;
1018-
if cache.len() != old_count {
1016+
if *cache != keys {
10191017
info!(
1020-
"Key refresh: {} -> {} keys",
1021-
old_count,
1022-
cache.len()
1018+
"Key cache updated: {} -> {} keys",
1019+
cache.len(),
1020+
keys.len()
10231021
);
1022+
*cache = keys;
10241023
}
10251024
}
10261025
Err(e) => {

0 commit comments

Comments
 (0)