mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
Allow tracing filters to be changed at runtime
ReloadHandle is taken from conduwuit commit 8a5599adf9eafe9111f3d1597f8fb333b8b76849, authored by Benjamin. Co-authored-by: Benjamin Lee <benjamin@computer.surgery>
This commit is contained in:
parent
f576aff7eb
commit
f89e1c7dfc
7 changed files with 145 additions and 29 deletions
|
|
@ -25,8 +25,9 @@ use ruma::{
|
|||
use tracing::{debug, error, info, info_span, warn, Instrument};
|
||||
|
||||
use crate::{
|
||||
config::DatabaseBackend, service::rooms::timeline::PduCount, services,
|
||||
utils, Config, Error, PduEvent, Result, Services, SERVICES,
|
||||
config::DatabaseBackend, observability::FilterReloadHandles,
|
||||
service::rooms::timeline::PduCount, services, utils, Config, Error,
|
||||
PduEvent, Result, Services, SERVICES,
|
||||
};
|
||||
|
||||
pub(crate) struct KeyValueDatabase {
|
||||
|
|
@ -310,7 +311,10 @@ impl KeyValueDatabase {
|
|||
allow(unreachable_code)
|
||||
)]
|
||||
#[allow(clippy::too_many_lines)]
|
||||
pub(crate) async fn load_or_create(config: Config) -> Result<()> {
|
||||
pub(crate) async fn load_or_create(
|
||||
config: Config,
|
||||
reload_handles: FilterReloadHandles,
|
||||
) -> Result<()> {
|
||||
Self::check_db_setup(&config)?;
|
||||
|
||||
if !Path::new(&config.database.path).exists() {
|
||||
|
|
@ -527,7 +531,8 @@ impl KeyValueDatabase {
|
|||
|
||||
let db = Box::leak(db_raw);
|
||||
|
||||
let services_raw = Box::new(Services::build(db, config)?);
|
||||
let services_raw =
|
||||
Box::new(Services::build(db, config, reload_handles)?);
|
||||
|
||||
// This is the first and only time we initialize the SERVICE static
|
||||
*SERVICES.write().unwrap() = Some(Box::leak(services_raw));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue