Only mark servers as offline if they fail pings 3+ times (#5664)

* wip: online status fix

* use INCR

* properly clear cache
This commit is contained in:
aecsocket
2026-03-26 06:34:20 +00:00
committed by GitHub
parent bf24ed8d12
commit da48a12551
8 changed files with 83 additions and 25 deletions

View File

@@ -788,6 +788,20 @@ impl RedisConnection {
.await?;
Ok(values)
}
#[tracing::instrument(skip(self))]
pub async fn incr(
&mut self,
namespace: &str,
id: &str,
) -> Result<Option<u64>, DatabaseError> {
let key = format!("{}_{namespace}:{id}", self.meta_namespace);
let value = cmd("INCR")
.arg(key)
.query_async(&mut self.connection)
.await?;
Ok(value)
}
}
#[derive(Serialize, Deserialize)]