use std::sync::Arc;
use super::super::SharedState;
pub(super) fn hydrate_caches(state: &Arc<SharedState>) {
SharedState::wire_session_handle_audit(state);
let catalog = state.credentials.catalog();
if let Err(e) = state.audit_dml_cache.load_from_catalog(catalog) {
tracing::warn!(error = %e, "boot: failed to populate audit_dml_cache from catalog");
}
if let Err(e) = state.collection_to_database.load_from_catalog(catalog) {
tracing::warn!(
error = %e,
"boot: failed to populate collection_to_database cache from catalog"
);
}
if let Err(e) = state.idle_timeout_cache.load_from_catalog(catalog) {
tracing::warn!(
error = %e,
"boot: failed to populate idle_timeout_cache from catalog"
);
}
}
pub(super) fn spawn_array_gc(state: &Arc<SharedState>) {
let _gc_handle = crate::control::array_sync::spawn_gc_task(
Arc::clone(&state.array_sync_op_log),
Arc::clone(&state.array_snapshot_store),
Arc::clone(&state.array_ack_registry),
Arc::clone(&state.array_snapshot_hlcs),
Arc::clone(&state.shutdown),
crate::control::array_sync::gc_task::DEFAULT_GC_INTERVAL,
);
}