JMAP Registry API implementation - part 6
This commit is contained in:
@@ -105,6 +105,8 @@ impl BroadcastBatch<Vec<BroadcastEvent>> {
|
||||
CacheInvalidation::Tenant(id) => (5u8, *id),
|
||||
CacheInvalidation::Role(id) => (6u8, *id),
|
||||
CacheInvalidation::List(id) => (7u8, *id),
|
||||
CacheInvalidation::DomainLogo(id) => (8u8, *id),
|
||||
CacheInvalidation::TenantLogo(id) => (9u8, *id),
|
||||
};
|
||||
|
||||
serialized.push(marker);
|
||||
@@ -216,6 +218,8 @@ where
|
||||
5 => CacheInvalidation::Tenant(id),
|
||||
6 => CacheInvalidation::Role(id),
|
||||
7 => CacheInvalidation::List(id),
|
||||
8 => CacheInvalidation::DomainLogo(id),
|
||||
9 => CacheInvalidation::TenantLogo(id),
|
||||
_ => return Err(()),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ pub fn spawn_broadcast_subscriber(inner: Arc<Inner>, mut shutdown_rx: watch::Rec
|
||||
}
|
||||
}
|
||||
BroadcastEvent::CacheInvalidation(changes) => {
|
||||
inner.build_server().invalidate_caches(changes, false).await;
|
||||
inner.build_server().invalidate_local_caches(&changes).await;
|
||||
|
||||
}
|
||||
BroadcastEvent::RegistryChange(change) => {
|
||||
|
||||
@@ -514,7 +514,7 @@ pub fn spawn_housekeeper(inner: Arc<Inner>, mut rx: mpsc::Receiver<HousekeeperEv
|
||||
Ok(total) => {
|
||||
Collector::update_gauge(
|
||||
MetricType::UserCount,
|
||||
total,
|
||||
total as u64,
|
||||
);
|
||||
}
|
||||
Err(err) => {
|
||||
@@ -530,7 +530,7 @@ pub fn spawn_housekeeper(inner: Arc<Inner>, mut rx: mpsc::Receiver<HousekeeperEv
|
||||
Ok(total) => {
|
||||
Collector::update_gauge(
|
||||
MetricType::DomainCount,
|
||||
total,
|
||||
total as u64,
|
||||
);
|
||||
}
|
||||
Err(err) => {
|
||||
|
||||
@@ -547,7 +547,7 @@ pub fn next_retry_time(
|
||||
TaskRetryStrategy::FixedDelay(fixed) => fixed.delay.as_secs(),
|
||||
TaskRetryStrategy::ExponentialBackoff(backoff) => {
|
||||
let delay = (backoff.initial_delay.as_secs() as f64
|
||||
* backoff.factor.powi(attempt as i32))
|
||||
* backoff.factor.into_inner().powi(attempt as i32))
|
||||
.min(backoff.max_delay.as_secs() as f64) as u64;
|
||||
|
||||
if backoff.jitter {
|
||||
|
||||
Reference in New Issue
Block a user