Added changelog and removed total guilds in KV in favor of Discord API

This commit is contained in:
DaXcess
2023-09-25 12:01:44 +02:00
parent c33d1ea2ce
commit 2daed2f704
3 changed files with 33 additions and 15 deletions
-8
View File
@@ -85,9 +85,6 @@ async fn main() {
let shard_manager = client.shard_manager.clone();
#[cfg(feature = "stats")]
let cache = client.cache_and_http.cache.clone();
#[cfg(unix)]
let mut term: Option<Box<dyn Any + Send>> = Some(Box::new(
tokio::signal::unix::signal(SignalKind::terminate())
@@ -104,13 +101,8 @@ async fn main() {
_ = tokio::time::sleep(std::time::Duration::from_secs(60)) => {
#[cfg(feature = "stats")]
{
let guild_count = cache.guilds().len();
let active_count = session_manager.get_active_session_count().await;
if let Err(why) = stats_manager.set_server_count(guild_count) {
error!("Failed to update server count: {why}");
}
if let Err(why) = stats_manager.set_active_count(active_count) {
error!("Failed to update active count: {why}");
}
-6
View File
@@ -12,12 +12,6 @@ impl StatsManager {
Ok(StatsManager { redis })
}
pub fn set_server_count(&self, count: usize) -> Result<()> {
let mut con = self.redis.get_connection()?;
con.set("sc-bot-total-servers", count.to_string())
}
pub fn set_active_count(&self, count: usize) -> Result<()> {
let mut con = self.redis.get_connection()?;