mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-13 04:06:54 +00:00
feat: Clear remote health tracking map when cache is cleared
This commit is contained in:
1 parent
e1866df682
commit
8f66cbb6b9
1 file changed
+7
@@ -3,6 +3,7 @@ mod execute;
|
||||
use std::{collections::HashMap, sync::Arc, time::Duration};
|
||||
|
||||
use assign::assign;
|
||||
use async_trait::async_trait;
|
||||
use conduwuit::{
|
||||
Error, Result, Server, SyncRwLock, debug,
|
||||
utils::{millis_since_unix_epoch, time::exponential_backoff::min_exp_backoff_duration},
|
||||
@@ -28,6 +29,7 @@ struct Services {
|
||||
moderation: Dep<moderation::Service>,
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl crate::Service for Service {
|
||||
fn build(args: crate::Args<'_>) -> Result<Arc<Self>> {
|
||||
Ok(Arc::new(Self {
|
||||
@@ -42,6 +44,11 @@ impl crate::Service for Service {
|
||||
}
|
||||
|
||||
fn name(&self) -> &str { crate::service::make_name(std::module_path!()) }
|
||||
|
||||
async fn clear_cache(&self) {
|
||||
let mut map = self.remote_health.write();
|
||||
map.clear();
|
||||
}
|
||||
}
|
||||
|
||||
impl Service {
|
||||
|
||||
Reference in new issue
Block a user