fix total_connections metric (#27603)

This commit is contained in:
kirill lykov 2022-09-06 18:36:55 +02:00 committed by GitHub
parent c620b7b34f
commit 56de885dea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -390,7 +390,6 @@ async fn setup_connection(
.await
{
if let Ok(new_connection) = connecting_result {
stats.total_connections.fetch_add(1, Ordering::Relaxed);
stats.total_new_connections.fetch_add(1, Ordering::Relaxed);
let params = get_connection_stake(&new_connection.connection, staked_nodes.clone())
@ -499,6 +498,7 @@ async fn handle_connection(
stats.total_streams.load(Ordering::Relaxed),
stats.total_connections.load(Ordering::Relaxed),
);
stats.total_connections.fetch_add(1, Ordering::Relaxed);
while !stream_exit.load(Ordering::Relaxed) {
if let Ok(stream) = tokio::time::timeout(
Duration::from_millis(WAIT_FOR_STREAM_TIMEOUT_MS),